Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: pambooPosted on 2002-12-17 at 19:27:17ID: 7599133
Yeah , u can use bitwise OR operator (|), so that the effect of several flags are combined together
Actually,u have 2 open system calls as follows ,
int open(const char *path, int flags);
int open(const char *path, int flags, mode_t mode);
PARAMETERS
path: [in] the path of the new file to create.
mode: [in] the new permission mask of the file. It is masked by the umask value: (mode & ~umask).
flags:
The flags parameter must be one of the following and u can combine flags using |:
O_RDONLY
the file is opened for reading.
O_WRONLY
the file is opened for writing.
O_RDWR
the file is opened for both reading and writing.
The following values may be or'ed together and with one of the preceding values:
O_CREAT
create the file if it does not exist.
O_EXCL
used with O_CREAT, if the file exists, the call fails. The test for existence and the creation if the file does not exists is atomic operation according to POSIX.1.
O_NOCTTY
the file will not become the controly tty of the task even if the file is a tty and the task does not have a controling terminal.
O_TRUNC
if the file already exists, truncate its lenght to 0.
O_APPEND
the file is opened for appending. The file pointer is always at the end of the file.
O_NONBLOCK or O_NDELAY
the calls manipulating the file never block.
O_SYNC
the file buffers are always synchronized with the on disk file. The write calls block until the data is completely written on disk. This is not POSIX.1.
create creates a new file. The new file is open for writing only. If a file with the same path already existed, then it is trucated.
And I think 1 and 0 u r talking is from the system APIs read and write .... 1 means Inoput device and 0 means outpurt device
For eg:
------
read(1,buf,buflen)
Read from the input buffer and store it in buf array
Okay friend ... See u ... Bye,
With love,
S.Nagarjan.