home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!gatech!darwin.sura.net!udel!rochester!rit!cci632!dwr
- From: dwr@cci632.cci.com (Donald W. Rouse II)
- Subject: Re: File protection on iostreams
- Message-ID: <1992Dec22.180556.23254@cci632.cci.com>
- Organization: [Computer Consoles, Inc., Rochester, NY
- References: <1992Dec15.212053.4733@pixel.kodak.com>
- Date: Tue, 22 Dec 1992 18:05:56 GMT
- Lines: 25
-
- In article <1992Dec15.212053.4733@pixel.kodak.com> morss@ssd.kodak.com (Charlie Morss) writes:
- >
- >According to Strus. the header files for fstream.h in the
- >third arguement for the open call specifies the
- >file protection mode, as in chmod, for the file
- >you are creating. When I use a protection mode of
- >664, when the file is created it has a protection
- >mode of 644, which is the default. Is there a
- >reason that the file protection mode is not
- >done correctly.
-
- Yes. Look at umask(2) and open(2) in your reference manual
- to see how they interact.
- Use the umask(1) command to examine or change your umask,
- or, in the program, you can do something like:
-
- int oldumask = umask (0);
- // do your open
- (void)umask (oldumask);
-
- [...]
- >P.P.S. If I do "normal" opens (old fashion C)
- > everything works fine!!
-
- Are you sure about this? It should suffer from the same problem.
-