Thread View: comp.std.unix
1 messages
1 total messages
Started by Sean Fagan
Wed, 07 Nov 1990 21:55
POSIX and symbolic links
Author: Sean Fagan
Date: Wed, 07 Nov 1990 21:55
Date: Wed, 07 Nov 1990 21:55
31 lines
1622 bytes
1622 bytes
Submitted-by: seanf@sco.COM (Sean Fagan)
I've been reading the September 1990 draft of 1003.1a (D4), and have a
question about symbolic links. The draft specifies that an open of a file
"foo" shall fail if opened with O_CREAT and O_EXCL *both* set (which makes
sense).
But what happens if only O_CREAT is set? To make it interesting, let's
throw in O_TRUNC as well. That is:
fd = open ("foo", O_CREAT|O_TRUNC|O_WRONLY, 0666);
Will the system follow the link, truncating whatever foo points to, if it
exists, or creating it otherwise, or will it truncate foo, creating a
regular file called "foo" with mode 0666&~umask?
My initial guess was that it would follow the link. However, I can think of
cases where you would not want it to do so (someone then prompted, "Well, if
the sticky bit of the symlink is set, then..." 8-)).
Thanks...
--
-----------------+
Sean Eric Fagan | "*Never* knock on Death's door: ring the bell and
seanf@sco.COM | run away! Death hates that!"
uunet!sco!seanf | -- Dr. Mike Stratford (Matt Frewer, "Doctor, Doctor")
(408) 458-1422 | Any opinions expressed are my own, not my employers'.
Volume-Number: Volume 22, Number 20
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads