File I/O wrappers without thread locking.

Note, that this is somewhat like builtin Python file I/O, but there are semantic differences to make it more efficient for some backing filesystems. For example, a write mode file will not be opened until the first write call (to minimize RPC invocations in network filesystems).

mode Returns the mode in which the file was opened.
name Returns the file name.



View source

Closes FileIO. Should be called for the WritableFile to be flushed.


View source

Flushes the Writable file.

This only ensures that the data has made its way out of the process without any guarantees on whether it's written to disk. This means that the data would survive an application crash but not necessarily an OS crash.


View source


View source

Returns the contents of a file as a string.

Starts reading from current position in file.

n Read n bytes if n != -1. If n = -1, reads to end of file.

n bytes of the file (or whole file) in bytes mode or n bytes of the string if in string (regular) mode.


View source

Reads the next line, keeping \n. At EOF, returns ''.


View source

Returns all lines