Xref: utzoo comp.sys.att:8311 unix-pc.general:4385 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!shadooby!sharkey!cfctech!ttardis!rlw From: rlw@ttardis.UUCP (Ron Wilson) Newsgroups: comp.sys.att,unix-pc.general Subject: Re: link of directory Keywords: linked directories Message-ID: <2395@ttardis.UUCP> Date: 20 Dec 89 05:13:57 GMT Organization: Gallifrey Lines: 39 In article <1989Dec14.210712.21973@ux1.cso.uiuc.edu>, bronsard@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.