SGI symlink bug?

Rob Warnock rpw3 at rigden.wpd.sgi.com
Fri Jun 15 12:33:52 AEST 1990


In article <900 at idunno.Princeton.EDU> viktor at cucumber.princeton.edu (Viktor Dukhovni) writes:
+---------------
| vjs at rhyolite.wpd.sgi.com (Vernon Schryver) writes:
| >I think the reason our `ln -s for bar` kills the target is because `ln foo
| >bar` and `mv foo bar` are always effective in the SVR3 world.  It seems to
| >me that `ln` and `ln -s` should be as identical as possible, except in the
| >nature of the link they make.  It would be bad if `ln foo bar` would
| >succeed where `ln -s foo bar` would fail.
| 	
| 	It is the behaviour of "ln" that seems wrong!  Note the
| corresponding system call ln(2) will fail with EEXIST.  "ln" must take
| special precaution to unlink the target before making the link,  this
| is unnatural.
+---------------

But the ln(1) *program* does succeed, even with hard links. Try this
on your favorite S5r3 system:

	% touch foo bar
	% ls -li foo bar
	12151 -rw-r--r--   1 rpw3     engr           0 Jun 14 19:31 bar
	12147 -rw-r--r--   1 rpw3     engr           0 Jun 14 19:31 foo
	% ln foo bar
	% ls -li foo bar
	12147 -rw-r--r--   2 rpw3     engr           0 Jun 14 19:31 bar
	12147 -rw-r--r--   2 rpw3     engr           0 Jun 14 19:31 foo

Sorry, that's System-V...   :-{

-Rob

-----
Rob Warnock, MS-9U/510		rpw3 at sgi.com		rpw3 at pei.com
Silicon Graphics, Inc.		(415)335-1673		Protocol Engines, Inc.
2011 N. Shoreline Blvd.
Mountain View, CA  94039-7311



More information about the Comp.sys.sgi mailing list