FSFile


Extension of NSFileHandle with methods convenient for text-file handling

Superclass: NSFileHandle
Declared In: FSFile.h



FSFile is a subclass of NSFileHandle that provides text-file handling methods similar to other scripting languages. To open a file, use FSFile's open: method, which uses the same mode specifiers as Perl's open function. You can then use readln, print:, println:, and printf:withValues: to perform input and output.



FSFile is a subclass of NSFileHandle, so the more fine-grained methods of that class for non-text files are also available, such as seeking through the file and calculating offsets. It is important to note that FSFile keeps its own buffer for readln and related methods, so mixing calls to readln and other NSFileHandle methods like seekToFileOffset: or readDataOfLength: will produce unpredictable results and will probably result in data being skipped. If you wish to switch between line- and offset-oriented modes, use the FSFile method reset. This method will clear all buffers and set the file pointer back to 0.





© Andrew Weinrich Last Updated: Wednesday, October 15, 2008
HTML documentation generated by HeaderDoc