VMS Help  —  CRTL  open  Arguments
 file_spec

    A null-terminated character string containing a valid file
    specification. If you specify a directory in the file_spec and
    it is a search list that contains an error, VSI C interprets
    it as a file open error.

    If the file_spec parameter refers to a symbolic link, the open
    function opens the file pointed to by the symbolic link.

 flags

    The following values are defined in the <fcntl.h> header file:

    O_RDONLY   Open for reading only
    O_WRONLY   Open for writing only
    O_RDWR     Open for reading and writing
    O_NDELAY   Open for asynchronous input
    O_APPEND   Append on each write
    O_CREAT    Create a file if it does not exist
    O_TRUNC    Create a new version of this file
    O_EXCL     Error if attempting to create existing file

    These flags are set using the bitwise OR operator (|)  to
    separate specified flags.

    Opening a file with O_APPEND causes each write on the file to
    be appended to the end. (In contrast, with the VAX C RTL the
    behavior of files opened in append mode was to start at EOF and,
    thereafter, write at the current file position.)

    If O_TRUNC is specified and the file exists, open creates a new
    file by incrementing the version number by 1, leaving the old
    version in existence.

    If O_CREAT is set and the named file does not exist, the C RTL
    creates it with any attributes specified in the fourth and
    subsequent arguments ( . . . ). If O_EXCL is set with O_CREAT and
    the named file exists, the attempted open returns an error.

 mode

    An unsigned value that specifies the file-protection mode. The
    compiler performs a bitwise AND operation on the mode and the
    complement of the current protection mode.

    You can construct modes by using the bitwise OR operator (|)  to
    separate specified modes. The modes are:

    0400   OWNER:READ
    0200   OWNER:WRITE
    0100   OWNER:EXECUTE
    0040   GROUP:READ
    0020   GROUP:WRITE
    0010   GROUP:EXECUTE
    0004   WORLD:READ
    0002   WORLD:WRITE
    0001   WORLD:EXECUTE

    The system is given the same access privileges as the owner. A
    WRITE privilege also implies a DELETE privilege.

  . . .

    Optional file attribute arguments. The file attribute arguments
    are the same as those used in the creat function. For more
    information, see the creat function.
Close Help