Search                        Top                                  Index
HELP SYSOPEN                                        Steven Hardy, March 1982

  sysopen(<filename>, <access mode>, <organization>) -> <device record>

SYSOPEN returns a device record for an already existing file. The
<filename> should be a string. The permissible access modes are:

        0 - Read only
        1 - Write only
        2 - Read and Write

Permissible values for <organization> are:

(a) TRUE: The file is block-oriented; the precise meaning of
this varies from device to device. For a terminal it means that all
characters will be treated as break characters and that no echoing will
be done. This is the organization used by VED.

(a) FALSE: For disk files and pipes, this value will optimise the device
for single character input or output, otherwise there is no difference
between <false> and <true>. For terminals this gives normal interactive
line mode (i.e. only whole lines can be read).

(c) LINE or RECORD: The file is record or line oriented. For
a terminal this means that only whole lines can be read, that is
*SYSREAD will read from the device only up to the next newline
character.

If the file cannot be opened because it does not exist, SYSOPEN returns
FALSE; if it cannot be opened for any other reason, a mishap occurs.

For more information on Input/Output procedures see REF *SYSIO.

See also HELP
    *SYSCLOSE  - closes the device which is its argument
    *SYSCREATE - creates a disc file and returns a device record for the file
    *SYSDELETE - deletes a specified disc file
    *SYSREAD   - reads from a specified device
    *SYSWRITE  - writes to a specified device