It is possible to open a file stream on an existing file descriptor by sending the on: message to the CfsFileStream class. The on: message answers an instance of the concrete stream class corresponding to the access mode of the file descriptor. An example of converting a file descriptor into a file stream is shown below:The on: message is also useful if the file is to be opened with a special share mode, using the open:oflag:share: message, which was discussed in "File locking". An example follows:
|