www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/06/06:35:48

Date: Wed, 6 May 1998 13:34:25 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Paul Shirley <Paul AT chocolat DOT obvious DOT fake DOT foobar DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Bug in djgpp 2.8.0b with open()?
In-Reply-To: <E023OHAm6bT1EwGg@foobar.co.uk>
Message-ID: <Pine.SUN.3.91.980506133205.1846G-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019