Hard links to directories: why not?

John F. Haugh II jfh at rpp386.cactus.org
Sun Jul 22 05:12:52 AEST 1990


In article <1990Jul19.121048.16332 at cbnews.att.com> mvadh at cbnews.att.com (andrew.d.hay) writes:
>it would be easy to have ln disallow this:
>1)	resolve argv[1] and argv[2] to absolute paths
>2)	determine which path is shorter
>3)	strncmp() both paths for the shorter length
>4)	if you have a match, you're trying to create a loop
>
>this would also let you safely mv directories...

So, how does this relate to the link() system call?  Permitting
a non-tree-like structure to exist is a really bad idea for all
of the reasons in the Dennis Ritchie quote.

Aren't there better things to worry about?  My favorite is why
doesn't the ln command require the use of a -f flag to blast a
target file?
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org

                                            Proud Pilot of RS/6000 Serial #1472



More information about the Comp.unix.wizards mailing list