Files | |
file | Files.c |
Linux-specific code for the File Management Wrappers. | |
file | Files.h |
File management declarations. | |
file | FilesSpecific.h |
Linux-specific declarations for the File Management Wrappers. | |
Data Structures | |
struct | ANetFile |
A cross-platform file identifier. More... | |
Functions | |
ANetFile | ANetInitFile () |
Initializes an ANetFile structure. More... | |
UInt32 | ANetGetSetFilePath (ANetFile *f, ANetMemoryTag path, UInt8 set) |
Gets or sets the file path of an ANetFile . More... | |
UInt32 | ANetGetSetFileAsync (ANetFile *f, UInt8 *async, UInt8 set) |
Gets or sets the asynchronous flag of an ANetFile . More... | |
UInt8 | ANetIsFileBusy (ANetFile *f) |
Returns the value of the "busy"flag of an ANetFile . More... | |
UInt32 | ANetGetFileSize (ANetFile *f, UInt32 *size) |
Gets the size of a file pointed by an ANetFile . More... | |
UInt32 | ANetOpenFile (ANetFile *f) |
Opens a file pointed by an ANetFile . More... | |
UInt32 | ANetCloseFile (ANetFile *f) |
Closes a file pointed by an ANetFile . More... | |
UInt32 | ANetReadFile (ANetFile *f, UInt32 startPos, UInt32 length, ANetMemoryTag buffer, UInt32 *read) |
Reads data from a file pointed bu an ANetFile . More... | |
UInt32 | ANetWriteFile (ANetFile *f, ANetMemoryTag buffer) |
Writes at the end of a file pointed by an ANetFile . More... | |
UInt32 | ANetWriteFileAt (ANetFile *f, ANetMemoryTag buffer, UInt32 pos) |
UInt32 | ANetDeleteFile (ANetFile *f) |
UInt32 | ANetCopyFile (ANetFile *source, ANetFile *dest) |
Here are the File Management Wrappers. They are "wrapper" functions that allow access to file management functions in a cross-platform way.
|
Closes a file pointed by an
ANetOpenFile() . If the file is set to asynchronous mode (see ANetGetSetFileAsync() ), then the function will immediately return and will set the "async" flag to true until the operation is done, when the "async" flag will be set to false again.
Definition at line 164 of file Files.c. References ANetMemoryTag. |
|
|
|
|
|
Gets the size of a file pointed by an
|
|
Gets or sets the asynchronous flag of an
ANetFile structure. If the "async" flag is true, then all the I/O operations done on the file will be asynchronous. Note that on some operating systems some functions might not support asynchronous I/O.
|
|
Gets or sets the file path of an
ANetFile structure pointed by f . You cannot change the path of the file while it is open or busy. Also not, all paths are accepted on every operating system, and so it is recommended that you do not go outside the directory that contains the ANet daemon.
Definition at line 44 of file Files.c. References ANetMemoryTag. |
|
Initializes an
ANetFile structure. This does not create any new file; to create a new file, set it's path to the new file's location (with ANetGetSetFilePath() ), then write some data in the file (with ANetWriteFile() );
|
|
Returns the value of the "busy"flag of an
ANetGetSetFileAsync() ) and some IO has not finished.
|
|
Opens a file pointed by an
f . While it is not required to open the file before using any of the following file operations, it is highly recommended that you open the file if you plan to do several operations on it. If the file is set to asynchronous mode (set ANetGetSetFileAsync() ), then the function will immediately return and will set the "busy" flag to true, until the operation is done, when the "busy" flag will set to false again.
|
|
Reads data from a file pointed bu an
startPos to endPos - 1 of the file into the buffer. The buffer must be big enough to contain the data that was read. Once the data is read, the value pointed by read will be changed to the number of bytes read into the buffer. If the value of read is smaller than length , then you can safely assume that the file was fully read. If the ANetOpenFile() function was not previously called on the file pointed by f , then this function will open the file before the read operation and close the file after the read operation. Otherwise, this function will not close the file after the read operation. This function does not support files bigger than 2^32 bytes. If the file is set to asynchronous mode (see ANetGetSetFileAsync() ), then the function will immediatly return and will set the "async" flag to true until the operation is done, when the "async" flag will be set to false again.
|
|
Writes at the end of a file pointed by an
ANetDeleteFile() first. If the file is set to asynchronous mode (see ANetGetSetFileAsync() ), then the function will immediatly return and will set the "async" flag to true until the operation is done, when the "async" flag will be set to false again.
|
|
|