Name: | File |
Version: | 1.0 |
ID: | ID_FILE |
Status: | Stable |
Include: | files/file.h |
Date: | February 2002 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems, 1996-2002. 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.
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 Changes the name of a file. 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 Copies the data of a file to another location. DeleteFile Deletes a file from its source location. MoveFile Moves a file to a new location. ReadBE Reads small blocks of big-endian file data. ReadLE Reads small blocks of little-endian file data. ReadLine Reads the next line from the file. SetFileDate Sets the date on a file. WriteBE Writes small blocks of big-endian file data. WriteLE Writes small blocks of little-endian file data.
The File object consists of the following public fields:
Comment A comment string describes what the file is. Date The file date stamp. Flags File flags and options. Link Allows you to read the link for symbolically linked files. Location Specifies the location of a 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. TimeStamp The last modification time set on a file, represented as a 64-bit integer.
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: | Copies the data of a file to another location. | |||||||||||||||||||||
Arguments: |
| |||||||||||||||||||||
|
Method: | DeleteFile() | |||||||||||
Short: | Deletes a file from its source location. | |||||||||||
|
Method: | MoveFile() | |||||||||||
Short: | Moves a file to a new location. | |||||||||||
Arguments: |
| |||||||||||
|
Method: | ReadBE() | |||||||
Short: | Reads small blocks of big-endian file data. | |||||||
Arguments: |
| |||||||
|
Method: | ReadLE() | |||||||
Short: | Reads small blocks of little-endian file data. | |||||||
Arguments: |
| |||||||
|
Method: | ReadLine() | |||||||||||||||||
Short: | Reads the next line from the file. | |||||||||||||||||
Arguments: |
| |||||||||||||||||
|
Method: | SetFileDate() | ||||||||||||
Short: | Sets the date on a file. | ||||||||||||
Arguments: |
| ||||||||||||
|
Method: | WriteBE() | |||||
Short: | Writes small blocks of big-endian file data. | |||||
Arguments: |
| |||||
|
Method: | WriteLE() | |||||
Short: | Writes small blocks of little-endian file data. | |||||
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 FileTime * | |
Status: | Get/Set | |
|
Field: | Flags | |||||||||||||||||
Short: | File flags and options. | |||||||||||||||||
Type: | LONG | |||||||||||||||||
Prefix: | FL | |||||||||||||||||
Status: | Read/Init | |||||||||||||||||
|
Field: | Link |
Short: | Allows you to read the link for symbolically linked files. |
Type: | STRING |
Status: | Get/Set |
Field: | Location | |
Short: | Specifies the location of a 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: | LARGE | |
Status: | Get/Set | |
|
Field: | Static | |
Short: | Set to TRUE if a file object should be static. | |
Type: | LONG | |
Status: | Read/Init | |
|
Field: | TimeStamp | |
Short: | The last modification time set on a file, represented as a 64-bit integer. | |
Type: | LARGE | |
Status: | Get | |
|