Low-level file functions
The following low-level file functions are equivalent to the following methods in the File class:
Function |
File class method |
FCLOSE( ) |
|
FCREATE( ) |
|
FEOF( ) |
|
FERROR( ) |
|
FFLUSH( ) |
|
FGETS( ) |
|
FOPEN( ) |
|
FPUTS( ) |
puts( ) and writeln( ) |
FREAD( ) |
|
FSEEK( ) |
|
FWRITE( ) |
These functions are not described separately. While a File object automatically maintains its file handle in its handle property, low-level file functions must explicitly specify a file handle, with the exception of FERROR( ), which does not act on a specific file. The FCREATE( ) and FOPEN( ) functions take the same parameters as the create( ) and open( ) methods, and return the file handle.
The other functions use the file handle as their first parameter and all other parameters (if any) following it The parameters following the file handle in the function are identical to the parameters to the equivalent method, and the functions return the same values as the methods.
Compare the examples for exists( ) and FILE( ) to see the difference between using a File object and low-level file functions.