delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/05/14:31:34

From: Paul Shirley <Paul AT chocolat DOT obvious DOT fake DOT foobar DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in djgpp 2.8.0b with open()?
Date: Mon, 4 May 1998 14:12:06 +0100
Organization: wot? me?
Message-ID: <E023OHAm6bT1EwGg@foobar.co.uk>
References: <19980429033703 DOT AAF3301 AT ppp104 DOT cartsys DOT com>
<Pine DOT SUN DOT 3 DOT 91 DOT 980503184236 DOT 19706l-100000 AT is>
NNTP-Posting-Host: chocolat.foobar.co.uk
Mime-Version: 1.0
Lines: 22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <Pine DOT SUN DOT 3 DOT 91 DOT 980503184236 DOT 19706l-100000 AT is>, Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> writes
>About O_RDONLY, O_WRONLY and O_RDWR:
>
>      ...the programmer *must* specify one of these.
>
>About O_TRUNC:
>
>      This flag should be used only on ordinary files open for
>      writing.
>
>So it seems to me that using O_TRUNC with no O_WRONLY or O_RDWR is an
>error, as far as Posix is concerned.

Surely it means its invalid on a file opened RDONLY, correct for WRONLY,
open to argument (but probably valid) on RDWR?

After all the perceived problem is that O_WRONLY/O_RDWR is not implicit
in O_TRUNC, buts needs to be explicitly supplied.

---
Paul Shirley: my email address is 'obvious'ly anti-spammed

- Raw text -


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