file(1)

NAME
file - file management

CALLING SEQUENCE
[unit]=file('open', file-name, [status], [access], [format], [recl])

PARAMETERS

open
    : string

file-name
    : string

status
    : string

access
    : string

format
    : string

recl
    : integer

DESCRIPTION
selects a logical unit unit and manages the file file-name. 'open' can be replaced by the parameter 'action' for managing the file (see below).

The status of the file is given by the parameter status :

    "new"
        : new file (default)

    "old"
        : file already exists.

    "unknown"
        : unknown status

    "scratch"
        : file is to be deleted at end of session

The type of access to the file is given by access

    "sequential"
        : sequential access (default)

    "direct"
        : direct access.

The other informations are the format

    "formatted"
        : for a formatted file (default)

    "unformatted"
        : binary record.

and recl is the size of records when access="direct"

A particular call is file([action],unit) : it modifies the state or the position inside a file with the following choices :

action is one of the following strings:

    "close"
        : closes the file

    "rewind"
        : puts the pointer at beginning of file

    "backspace"
        : puts the pointer at beginning of last record.

    "last"
        : puts the pointer after last record.

and the logical unit is unit.

SEE ALSO
save, load, write, read