Date: Wed, 6 May 1998 13:34:25 +0300 (IDT) From: Eli Zaretskii To: Paul Shirley cc: djgpp AT delorie DOT com Subject: Re: Bug in djgpp 2.8.0b with open()? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.