home *** CD-ROM | disk | FTP | other *** search
-
-
-
- OPEN(3) MINTLIB LIBRARY FUNCTIONS OPEN(3)
-
-
- N✓NA✓AM✓ME✓E
- open - open or create a file for reading or writing
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
- #include <fcntl.h>
-
- int open(const char *filename, int flags, ...);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- filename points to the pathname of a file. open opens the
- named file for reading and/or writing, as specified by the
- flags argument, and returns a descriptor for that file.
- The flags argument may indicate the file is to be created
- if it does not already exist (by specifying the O_CREAT
- flag). In this case an extra integer parameter pmode is
- used; the file is created with mode pmode as described in
- chmod and modified by the process' umask value (see
- umask).
-
- flags values are constructed by ORing flags from the fol-
- lowing list (one and only one of the first three flags
- below must be used):
- - O_RDONLY Open for reading only.
- - O_WRONLY Open for writing only.
- - O_RDWR Open for reading and writing.
-
- - O_NDELAY Non-blocking I/O.
- - O_SYNC Synchronize after writes (not implemented).
- - O_APPEND If set, the seek pointer will be set to
- the end of the file prior to each write.
- - O_CREAT Create the file if it doesn't exist already.
- - O_TRUNC If the file exists and is a regular file,
- and the file is successfully opened using
- O_RDWR or O_WRONLY, its length is truncated
- to zero.
- - O_EXCL If O_EXCL and O_CREAT are set, open will
- fail if the file exists.
-
- The seek pointer used to mark the current position within
- the file is set to the beginning of the file.
-
- The new descriptor is set to remain open across execve
- system calls; see close and fcntl.
-
- R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
- open returns a non-negative file descriptor on success.
- On failure, it returns -1 and sets errno to indicate the
- error.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- c✓ch✓hm✓mo✓od✓d(✓(3✓3)✓),✓, c✓cl✓lo✓os✓se✓e(✓(3✓3)✓),✓, c✓cr✓re✓ea✓at✓t(✓(3✓3)✓),✓, d✓du✓up✓p(✓(3✓3)✓),✓, f✓fc✓cn✓nt✓tl✓l(✓(3✓3)✓),✓, l✓ls✓se✓ee✓ek✓k(✓(3✓3)✓),✓,
- r✓re✓ea✓ad✓d(✓(3✓3)✓),✓, u✓um✓ma✓as✓sk✓k(✓(3✓3)✓),✓, w✓wr✓ri✓it✓te✓e(✓(3✓3)✓)
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-