www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/05/22:22:14

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: v2 funnies
Date: Fri, 06 Dec 1996 02:33:12 GMT
Organization: Oxford University
Lines: 29
Message-ID: <32a7854f.19210194@news.ox.ac.uk>
References: <199612051809 DOT KAA12682 AT xavier DOT cs DOT pdx DOT edu>
NNTP-Posting-Host: mc31.merton.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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