CFile Class
The CFile class provides file reading and writing operations. Normally, this class is used for binary-mode file operations. You also can use it for text-mode file operations but the lua language includes an excellent io package for working with text files..
Construction |
Object = CFile:new() |
Destruction |
Object:delete() |
This class contains 3 enumeration properties for use with the Seek method:
eBegin |
The file offset is moved relative to the beginning of the file. |
eCurrent |
The file offset is moved relative to the current position. |
eEnd |
The file offset is moved relative to the end of the file. |
Creates a new instance of a CFile object. |
|
Deletes the instance of the CFile object. |
Closes the file. |
|
Returns the current file position. |
|
Commits data in the operating system buffer to the file. |
|
Returns the name of the file. |
|
Opens the file. |
|
Writes formatted text to the file. |
|
Reads a value or table of values of specified data type from a binary file. |
|
Reads a value or table of values of specified data type from a binary file. The values are automatically byte-swapped. |
|
Resets the file position to a given location. |
|
Writes a value or table to a binary file using the specified data type. |
|
Writes a value or table to a binary file using the specified data type. The values are automatically byte-swapped before being written to the file. |