F_OPEN_FILE

Syntax

int_val = F_OPEN_FILE ( pathname, mode );
Input arguments
string pathname The file to be opened.
string mode r – Read ASCII file.
w – Write to ASCII file (deletes existing contents).
a – Add to ASCII file.
ru – Read UTF-8 file.
wu – Write to UTF-8 file (deletes existing contents).
au – Add to UTF-8 file.

Return Values

Success:
handle filehandle Non-negative integer as the file handle.
Failure:
int -1 Script interface error.

Description

This function opens a given file for reading or writing and returns a file handle that identifies the file in subsequent file access calls.

The 'mode' argument specifies whether to read, write or append to the file and whether the file uses ASCII or UTF-8 character encoding.

The file must exist, also when it is opened for writing. It is an error to try to open a file that is already open.