tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* mkdir(2) then fopen(file, "w") under it failure
@ 1995-04-27  1:07 haymanR
  0 siblings, 0 replies; only message in thread
From: haymanR @ 1995-04-27  1:07 UTC (permalink / raw)
  To: tru64-unix-managers

Greetings - 

I am running Digital UNIX (aka OSF/1) v3.2 r214 with Enhanced Security.
I have some C code which I am working on and am getting a failure on 
both calls to creat() and fopen() after a successful mkdir(). Errno
indicates "No such file or directory".  So I then add an 

if( NULL == (dst_dfd = opendir(dst_dir)) )
   fprintf(stderr,"copy_dir: Can't open dst_dir (%s).\n", dst_dir);
else
    closedir(dst_dfd);

and sure enough, after a successful mkdir(), the directory in question
can't be opened.  Now this has me befuddled, because when the routine then
exits, I look and the directory does exist.  What am I missing?

Also, there was a question recently about Enhanced Security forcing a mask
of 077 on mkdir() creates regardless of the mode passed.  Has that been
answered/summarized yet?  The workaround I'm using is to mkdir() immediately
followed by chmod() with the same modes as sent to mkdir().

TIA.  Summary pending responses.

Randy M. Hayman
haymanr@icefog.alaska.edu

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-04-27  1:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-04-27  1:07 mkdir(2) then fopen(file, "w") under it failure haymanR

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox