Mail Archives: djgpp/1996/12/05/22:22:14
On Thu, 5 Dec 1996 18:09:10 GMT, Ian D Romanick <idr AT cs DOT pdx DOT edu>
wrote:
>Well, ANSI doesn't specify *anything* for open: it's not part of the
>standard. But looking at the man page on a Solaris (POSIX) sytem, it
>shows the prototype as:
>
> int open(const char *path, int oflag, /* mode_t mode */ ...);
>
>It also only mentions the use of the mode field if O_CREAT is set in the
>oflag field. So it seems that this is perfectly valid usage.
More to the point, the libc docs (info) have it as:
int open(const char *file, int mode /*, int permissions */);
and it goes on to say:
"If the file is created by this call, it will be given the read/write
permissions specified by PERMISSIONS, which may be any combination of
these values:" and describes the S_I* constants.
I interpret this as meaning that it is optional if you are opening an
existing file, but mandatory if you are creating the file.
(I still haven't received Eli's reply, so I apologise if I'm
duplicating information here)
George Foot
- Raw text -