using utimes(2) to change the time of a link

Arnold Robbins arnold at gatech.CSNET
Thu Aug 1 03:23:41 AEST 1985


In article <266 at brl-tgr.ARPA>, gwyn at brl-tgr.ARPA (Doug Gwyn <gwyn>) writes:
> Why are there so many inquiries about doing things to the symbolic
> links instead of to the files to which they point?  It doesn't seem
> to be necessary..

It sure is necessary if you're writing/using a file system backup program.
I've been converting a really nice program from System V to 4.2 BSD, and
symbolic links have been the hardest part.  As it currently stands, when
restoring a symbolic link, you can't restore the mod time on the link itself,
or change the mode. (In fact, I have to now add code to check for that!)

I hope 4.3 cleans up some of their semantics.  For instance, the following
code creates a symlink that 'ls' says is l--------- (mode 000):

	...
	umask (0777);
	symlink ("old", "new");
	...

'new' is mode 000, but a readlink(new,...) will succeed!  I'm not sure exactly
what should happen, but I don't think the readlink should succeed.

In sum, I think symbolic links are nifty things, but there are some things
about them that could use redefining (or at least clarifying).
-- 
Arnold Robbins
CSNET:	arnold at gatech	ARPA:	arnold%gatech.csnet at csnet-relay.arpa
UUCP:	{ akgua, allegra, hplabs, ihnp4, seismo, ut-sally }!gatech!arnold

Hello. You have reached the Coalition to Eliminate Answering Machines.
Unfortunately, no one can come to the phone right now....



More information about the Comp.bugs.4bsd.ucb-fixes mailing list