This is an abstract class. It defines most methods implemented by its
child classes, like DiskFile
,
MemoryFile
and PipeFile
.
Methods defined here are intended for basic read/write functionalities.
Read/write methods might write in ASCII
mode or
binary mode.
In ASCII
mode, numbers are converted in human readable
format (characters). Booleans are converted into 0
(false) or 1
(true).
In binary mode, numbers and boolean are directly encoded
as represented in a register of the computer. While not being human
readable and less portable, the binary mode is obviously faster.
In ASCII
mode, if the default option
autoSpacing()
is chosen, a space will be generated
after each written number or boolean. A carriage return will also be added
after each call to a write method. With this option, the spaces are
supposed to exist while reading. This option can be deactivated with
noAutoSpacing()
.
A Lua
error might or might be not generated in case of read/write error
or problem in the file. This depends on the choice made between
quiet()
and pedantic()
options. It
is possible to query if an error occured in the last operation by calling
hasError()
.
Lua
style read/write methodsascii()
[default]autoSpacing()
[default]binary()
clearError()
close()
[boolean] hasError()
[boolean] isQuiet()
[boolean] isReadable()
[boolean] isWritable()
noAutoSpacing()
synchronize()
pedantic()
[default][number] position()
quiet()
seek(position)
seekEnd()