Name: | File |
Version: | 1.0 |
ID: | ID_FILE |
Status: | Unspecified |
Include: | files/file.h |
Date: | May 2001 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems, 1996-2001. All rights reserved. |
The File class is used for basic file management purposes. Unlike file handles in other systems, this object allows you to find out many details on a file with little effort. The class supports the notion of individual file compression and file finding capabilities. Since all File objects are tracked, there is no chance of the system leaving locked files behind after a program exits. Directory management is also integrated into this class to ease the management of both file types.
To read or write to a file, you need to set the Location of the file as well as the correct I/O file flags before initialisation. See the Flags field for information on the available I/O flags. Functionality for read and write operations is provided through the Read and Write actions. You can also use the Seek action to change your read/write position in a File.
Note: File compression has been temporarily removed in the Linux version, but will resurface at a later stage of development.
The File class supports the following actions:
Activate Activating a File object will cause it to activate its children. ClosingTag If a File object is non-static, calling this action will cause it to self-destruct. Init Initialises a File. Read Reads data from a File. Rename Renames a File's location. Seek Seeks to a new read/write position within a File. Write Writes data to a File.
The File class implements the following methods:
CopyFile Makes a copy of a File's data by copying it to another location. DeleteFile Deletes a File's data from its source location. MoveFile Moves File data to new locations. ReadFileLong Reads file data in 32-bit chunks. ReadFileWord Reads file data in 16-bit chunks.
The File object consists of the following public fields:
Comment A comment string describes what the File is. Date The File date stamp. DirectoryList Returns a list of folders in a File directory. FileList Returns a list of files in a File directory. Flags File flags and options. Location Specifies the location of the File. Position The current read/write byte position in a File. Size The byte size of a File. Static Set to TRUE if a File object should be static.
Action: | Init | |||||||||||||
Short: | Initialises a File. | |||||||||||||
|
Action: | Read | |||||||||||
Short: | Reads data from a File. | |||||||||||
|
Action: | Write | |||||||||||
Short: | Writes data to a File. | |||||||||||
|
Method: | CopyFile() | |||||||||||||||||||||
Short: | Makes a copy of a File's data by copying it to another location. | |||||||||||||||||||||
Arguments: |
| |||||||||||||||||||||
|
Method: | DeleteFile() | |||||||
Short: | Deletes a File's data from its source location. | |||||||
|
Method: | MoveFile() | |||||||||||
Short: | Moves File data to new locations. | |||||||||||
Arguments: |
| |||||||||||
|
Method: | ReadFileLong() | |||||||
Short: | Reads file data in 32-bit chunks. | |||||||
Arguments: |
| |||||||
|
Method: | ReadFileWord() | |||||||
Short: | Reads file data in 16-bit chunks. | |||||||
Arguments: |
| |||||||
|
Field: | Comment | |
Short: | A comment string describes what the File is. | |
Type: | STRING | |
Status: | Get/Set | |
|
Field: | Date | |
Short: | The File date stamp. | |
Type: | struct Time * | |
Status: | Get/Set | |
|
Field: | DirectoryList | |
Short: | Returns a list of folders in a File directory. | |
Type: | STRING * | |
Status: | Get | |
|
Field: | FileList | |
Short: | Returns a list of files in a File directory. | |
Type: | STRING ** | |
Status: | Get | |
|
Field: | Flags | |||||||||||
Short: | File flags and options. | |||||||||||
Type: | LONG | |||||||||||
Prefix: | FL | |||||||||||
Status: | Read/Init | |||||||||||
|
Field: | Location | |
Short: | Specifies the location of the File. | |
Type: | STRING | |
Status: | Get/Set | |
|
Field: | Position | |
Short: | The current read/write byte position in a File. | |
Type: | LONG | |
Status: | Read | |
|
Field: | Size | |
Short: | The byte size of a File. | |
Type: | LONG | |
Status: | Get | |
|
Field: | Static | |
Short: | Set to TRUE if a File object should be static. | |
Type: | LONG | |
Status: | Read/Init | |
|