home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / std_unix / v22 / 020 / text0000.txt < prev   
Encoding:
Text File  |  1991-03-07  |  1.1 KB  |  33 lines

  1. Submitted-by: seanf@sco.COM (Sean Fagan)
  2.  
  3. I've been reading the September 1990 draft of 1003.1a (D4), and have a
  4. question about symbolic links.  The draft specifies that an open of a file
  5. "foo" shall fail if opened with O_CREAT and O_EXCL *both* set (which makes
  6. sense).
  7.  
  8. But what happens if only O_CREAT is set?  To make it interesting, let's
  9. throw in O_TRUNC as well.  That is:
  10.  
  11.     fd = open ("foo", O_CREAT|O_TRUNC|O_WRONLY, 0666);
  12.  
  13. Will the system follow the link, truncating whatever foo points to, if it
  14. exists, or creating it otherwise, or will it truncate foo, creating a
  15. regular file called "foo" with mode 0666&~umask?
  16.  
  17. My initial guess was that it would follow the link.  However, I can think of
  18. cases where you would not want it to do so (someone then prompted, "Well, if
  19. the sticky bit of the symlink is set, then..." 8-)).
  20.  
  21. Thanks...
  22.  
  23. -- 
  24. -----------------+
  25. Sean Eric Fagan  | "*Never* knock on Death's door:  ring the bell and 
  26. seanf@sco.COM    |   run away!  Death hates that!"
  27. uunet!sco!seanf  |     -- Dr. Mike Stratford (Matt Frewer, "Doctor, Doctor")
  28. (408) 458-1422   | Any opinions expressed are my own, not my employers'.
  29.  
  30.  
  31.  
  32.  
  33.