Next: FileDescriptor class-still unclassified, Previous: FileDescriptor class-initialization, Up: FileDescriptor [Index]
Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file.
Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file.
Open fileName in the required mode - answered by #append, #create, #readWrite, #read or #write - and fail if the file cannot be opened. Else answer a new FileStream. For mode anyway you can use any standard C non-binary fopen mode. The file will be automatically closed upon GC if the object is not referenced anymore, but it is better to close it as soon as you’re finished with it anyway, using #close. To keep a file open even when no references exist anymore, send it #removeToBeFinalized
Open fileName in the required mode - answered by #append, #create, #readWrite, #read or #write - and evaluate aBlock if the file cannot be opened. Else answer a new FileStream. For mode anyway you can use any The file will be automatically closed upon GC if the object is not referenced anymore, but it is better to close it as soon as you’re finished with it anyway, using #close. To keep a file open even when no references exist anymore, send it #removeToBeFinalized
Open a FileDescriptor on the given file descriptor. Read-write access is assumed.
Open fileName in read-write mode - fail if the file cannot be opened. Else answer a new FileStream. The file will be automatically closed upon GC if the object is not referenced anymore, but you should close it with #close anyway. To keep a file open, send it #removeToBeFinalized
Open fileName in the required mode - answered by #append, #create, #readWrite, #read or #write - and evaluate aBlock if the file cannot be opened. Else answer a new instance of the receiver. For mode anyway you can use any standard C non-binary fopen mode. fileName can be a ‘virtual filesystem’ path, including URLs and ’#’ suffixes that are inspected by the virtual filesystem layers and replaced with tasks such as un-gzipping a file or extracting a file from an archive.
The file will be automatically closed upon GC if the object is not referenced anymore, but it is better to close it as soon as you’re finished with it anyway, using #close. To keep a file open even when no references exist anymore, send it #removeToBeFinalized
Open for writing a file whose name starts with baseName, followed by six random alphanumeric characters. The file is created with mode read/write and permissions 0666 or 0600 on most recent operating systems (beware, the former behavior might constitute a security problem). The file is opened with the O_EXCL flag, guaranteeing that when the method returns successfully we are the only user.
Open a pipe on the given command and fail if the file cannot be opened. Else answer a new FileStream. The pipe will not be automatically closed upon GC, even if the object is not referenced anymore, because when you close a pipe you have to wait for the associated process to terminate. direction is returned by #read or #write (’r’ or ’w’) and is interpreted from the point of view of Smalltalk: reading means Smalltalk reads the standard output of the command, writing means Smalltalk writes the standard input of the command. The other channel (stdin when reading, stdout when writing) is the same as GST’s, unless commandName alters it.
Open a pipe on the given command and evaluate aBlock file cannot be opened. Else answer a new FileStream. The pipe will not be automatically closed upon GC, even if the object is not referenced anymore, because when you close a pipe you have to wait for the associated process to terminate. direction is interpreted from the point of view of Smalltalk: reading means that Smalltalk reads the standard output of the command, writing means that Smalltalk writes the standard input of the command
Open text file for reading. The stream is positioned at the beginning of the file.
Open for reading and writing. The stream is positioned at the beginning of the file.
Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.
Next: FileDescriptor class-still unclassified, Previous: FileDescriptor class-initialization, Up: FileDescriptor [Index]