link of directory

Ron Wilson rlw at ttardis.UUCP
Wed Dec 20 16:13:57 AEST 1989


In article <1989Dec14.210712.21973 at ux1.cso.uiuc.edu>, bronsard at m.cs.uiuc.edu (Francois Bronsard) writes:
>I am using an unix system V that doesn't allow symbolic link to directory.
>I was told that I could get around that by using the system call link if I
>am root. However this will create an hard link, so I was also warned that
>this might be a dangerous idea. My question now is: How dangerous?
>Specifically I only want to add to my top directory a link to Filecabinet
>(the reason being that I am using a MsDos program that doesn't understand
>lowercase characters so it cannot find the directory Filecabinet, so I
>thought of adding a link to it called FILES to be able to access
>Filecabinet). In that specific case what are the exact dangers and problems
>with creating a second hard link to a directory? 
>(I emphasize this specific case because I know that one could for example
>create a loop of links which, I have no doubt, would make the system crash
>sooner or later).
>
>Francois

One problem is that the .. entry in the linked directory ALWAYS points
to the original parent directory - something that BSD UNIX and friends
handle in the file manager - thus:

        cd /u/q
        mkdir x
        ls
           t u v x
        cd /u/y
        link /u/q/x x
        ls
           x y z
        ls x/..
           t u v x

In BSD dirived UNIX systems, .. "points" to the "parent" you entered
the dirctory from - so you won't see the results above.

Another problem, you can NOT remove a hardlink to a directory without
first removing the contents of the directory - rmdir can have very
startling results in this instance - you can NOT use it like you can
use rm or unlink on a NON-direcory file.



More information about the Unix-pc.general mailing list