Mail Archives: djgpp/1998/05/06/06:35:48
On Mon, 4 May 1998, Paul Shirley wrote:
> Surely it means its invalid on a file opened RDONLY, correct for WRONLY,
> open to argument (but probably valid) on RDWR?
I don't see why O_RDWR is open to argument. It seems to me that O_RDWR
allows writing to the file, and so O_TRUNC should work (and it does work
in DJGPP).
> After all the perceived problem is that O_WRONLY/O_RDWR is not implicit
> in O_TRUNC, buts needs to be explicitly supplied.
Posix explicitly says that one of O_READONLY, O_RDWR or O_WRONLY *must*
be specified. So even if O_TRUNC does specify one of the implicitly, you
*must* use one of them as well.
- Raw text -