Parent classes: File
DiskFile is a particular
File which is able to perform basic read/write operations
on a file stored on disk. It implements all methods described in File, and
some additional methods relative to endian encoding.
The file might be open in read, write, or read-write mode, depending on the parameter
mode (which can take the value
given to the torch.DiskFile(fileName, mode).
torch.DiskFile(fileName, [mode], [quiet])
Constructor which opens
fileName on disk, using the given
"w" (write) or
"rw" (read-write). Default is read mode.
If read-write mode, the file will be created if it does not exists. If it exists, it will be positioned at the beginning of the file after opening.
If (and only if)
true, no error will be raised in case of
problem opening the file: instead
nil will be returned.
The file is opened in ASCII mode by default.
In binary mode, force encoding in big endian. (big end first: decreasing numeric significance with increasing memory addresses)
true if, and only if, the computer CPU operates in big endian.
Big end first: decreasing numeric significance with increasing
true if, and only if, the computer CPU operates in little endian.
Little end first: increasing numeric significance with increasing
In binary mode, force encoding in little endian. (little end first: increasing numeric significance with increasing memory addresses)
In binary mode, force encoding in native endian.
Longs will be written and read from the file as
size bytes long, which
can be 0, 4 or 8. 0 means system default.
Disables read and write buffering on the