Constants
Types
Signed 8-bit integer, -128..127.
Unsigned 8-bit integer, 0..255.
A file object
(* Residue (byte count not read) at eof of ReadBytes *)
(* TRUE when end of file is reached. Should be checked after calling Read procedures. *)
Rider on a file. Used to read or write data from/to a file. Can be set in a arbitrary place in a file. Automatically moves forward in a file every time it is used for reading or writing.
Variables
Procedures
Returns a file object that was connected to rider r
with Set.
Sets current working directory to path
.
Sets res
to 0 on success, non-0 on failure.
Flushes the contents of the file to storage media. The file can still be used after a call to Close.
Deletes (deregisters) a file with the given name from the storage media.
Sets res
to 0 on success, 1 on error.
IMPORTANT! It uses SearchPath to find the specified file.
Puts in t
and d
the time and date of the file in a special bit format:
d = YYYYYYYMMMMDDDDD Y-year M-month D-day t = HHHHmmmmmmSSSSSS H-hour m-minute S-second
The year bits hold the two last digits of the year
Puts in name
the naem of the file f
.
Returns the length of the given file in bytes
Creates and returns a file object with the given file name.
This procedure is used to create new files or rewrite old files, but New does not delete or rewrite the file if it existed — this is done by Register or Close.
Opens a file with the given file name if it exists. Returns the object representing the file. If the file does not exist, returns NIL.
If you write to a file opened with Old, the changes will be stored in the storage medium only after a call to Register or Close.
Returns position of rider r
in the file.
Note that the position is measured in bytes (and not characters, each of which is coded in UTF-8 as 1, 2, 3 or 4 bytes).
Position 0 means the position exactly before the very first byte of the file. Position Length() points at exactly after the last byte.
Frees the sectors of storage device used by the file
Reads one byte from a file and puts it in x
.
The rider r
must have been set to a file using Set.
Reads one byte from a file and puts it in x
as a BOOLEAN value, where byte value of 0 means FALSE, other values mean TRUE.
The rider r
must have been set to a file using Set.
Reads several bytes from a file and puts it in x
. Puts the number of bytes read in n
.
The rider r
must have been set to a file using Set.
Reads up to four bytes (but at least one byte) from a file, interprets them as a UTF-8-encoded character and puts the decoded character in x
(as 2 bytes in UCS-2 format).
The rider r
must have been set to a file using Set.
Reads four bytes from a file and puts them in x
as an INTEGER.
The rider r
must have been set to a file using Set.
Reads eight bytes from a file and puts them in x
as a LONGINT.
The rider r
must have been set to a file using Set.
Reads eight bytes from a file and puts it in x
as LONGREAL.
The rider r
must have been set to a file using Set.
Reads bytes from a file until the first 0X, 0AX or 0DX byte, puts all in x
(except the last byte).
The rider r
must have been set to a file using Set.
Reads one or more bytes from a file to decode a compact number
(according to M. Odersky), puts the number read in x
.
The rider r
must have been set to a file using Set.
Reads four bytes from a file and puts it in x
as REAL.
The rider r
must have been set to a file using Set.
Reads two bytes from a file and puts them in x
as a SHORTINT.
The rider r
must have been set to a file using Set.
Reads four bytes from a file and puts it in x
as a SET.
The rider r
must have been set to a file using Set.
Reads one byte from a file and puts it in x
as a short (ASCII) character.
The rider r
must have been set to a file using Set.
Reads bytes from a file until the first zero byte, puts all in x
.
The rider r
must have been set to a file using Set.
Reads a file character by character until the first 0X, puts all in x
.
The rider r
must have been set to a file using Set.
Registers and saves a file on the storage media.
Call Register when you are finished writing a file. Register can be called several times and anywhere in between.
Renames a file with the name old
to new
.
Sets res
to 0 on success, non-0 on error.
res = 2
means file not found.
IMPORTANT! It uses SearchPath to find the specified file.
Sets rider r
at position pos
of the file f
.
Use this procedure after successfully opening a file with Old or New.
Note that the position is measured in bytes (and not characters, each of which is coded in UTF-8 as 1, 2, 3 or 4 bytes). Position 0 means the position exactly before the very first byte of the file. Position Length() points at exactly after the last byte.
Sets a search path for Old, New, Delete, Rename etc.
Truncates a file at position pos
. The file length will be equal to pos
.
Writes a single byte x
to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes BOOLEAN x
as one byte to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes n
bytes from array x
to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media. Записывает в файл n
байт из массива x
.
Бегунок r
должен быть установлен на файл с помощью Set.
Файл не записывается на носитель сразу.
Writes character x
as UTF-8 to a file (1 to 4 bytes).
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes INTEGER x
as four bytes to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes LONGINT x
as eight bytes to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes LONGREAL x
as eight bytes to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes INTEGER x
as one or more bytes to a file in a compact number format (according to M. Odersky).
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes REAL x
as four bytes to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes SHORTINT x
as two bytes to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes SET x
as four bytes to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes short (1-byte) character x
to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes string x
consising of a 1-byte characters to a file.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Writes string x
to a file in UTF-8 format.
The rider r
must have been set to a file using Set.
The file is not immediately written on a storage media.
Input-output of standard data types from/to a storage media.
```.
```