File Class

A File object can be obtained by calling OpenFile(). File objects should be closed with delete or Close(). Note that, "delete file" does not actually a file, it just closes it.

Methods 17

Name Description
Close

Close the file handle. This is the same as using CloseHandle) or delete.

EndOfFile

Tests if the end of file has been reached.

Read

Reads binary data from a file.

ReadInt16

Reads a single int16 (short) from a file. The value is sign-extended to an int32.

ReadInt32

Reads a single int32 (int/cell) from a file.

ReadInt8

Reads a single int8 (byte) from a file. The returned value is sign- extended to an int32.

ReadLine

Reads a line of text from a file.

ReadString

Reads a UTF8 or ANSI string from a file.

ReadUint16

Reads a single unt16 (unsigned short) from a file. The value is zero- extended to an int32.

ReadUint8

Reads a single uint8 (unsigned byte) from a file. The returned value is zero-extended to an int32.

Seek

Sets the file position indicator.

Write

Writes binary data to a file.

WriteInt16

Writes a single int16 (short) to a file.

WriteInt32

Writes a single int32 (int/cell) to a file.

WriteInt8

Writes a single int8 (byte) to a file.

WriteLine

Writes a line of text to a text file. A newline is automatically appended.

WriteString

Writes a binary string to a file.

Properties 1

Name Type Description
Positionint

Get the current position in the file; returns -1 on failure.