_open()                  Open a File For Reading or Writing
 
 #include   <fcntl.h>
 #include   <io.h>
 
 int        _open(pathname,access);
 char       *pathname;                   Name of file
 int        access;                      Access mode
 
    _open() opens the file specified by 'pathname', then prepares the
    file for reading and/or writing as defined by 'access'. The value of
    'access' is constructed by combining a constant from the following
    list:
 
          O_RDONLY          Open for reading only
          O_WRONLY          Open for writing only
          O_RDWR            Open for reading and writing
 
    along with the following additional values:
 
          O_NOINHERIT       Included if the file is not to be passed to child
                            programs.
          O_DENYALL         Allows only the current handle to have access to
                            the file.
          O_DENYWRITE       Allows only reads from any other open to the
                            file.
          O_DENYREAD        Allows only writes from any other open to the
                            file.
          O_DENYNONE        Allows other shared opens to the file.
 
    Only one of the O_DENYxxx values may be included in a single _open()
    under DOS 3.x.  These file-sharing attributes are in addition to any
    locking performed on the files.
 
    Returns:    On success, the file handle (a non-negative integer) is
                returned. The file pointer that marks the current
                position in the file is set to the beginning of the file.
                On error, -1 is returned and 'errno' (defined in
                <stdlib.h>) is set to one of the following:
 
          ENOENT            Path or file name not found
          EMFILE            Too many open files
          EACCES            Permission denied
          EINVACC           Invalid access code

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster