fnf@estinc.UUCP (Fred Fish) (09/07/89)
In article <13842@super.ORG> rminnich@super.UUCP (Ronald G Minnich) writes: >>fnf@estinc.UUCP (Fred Fish) writes: >>>This is not exactly related to the Amiga but here goes anyway. This >>>is on SCO Xenix 2.3.1, and should work on probably any Unix, including >>>a Sun... >Anyway, on a sunos system, here is a transcript: >super# ln bin binxxx >bin is a directory >super# Note that there is a difference between using the "ln" executable (which I believe will probably refuse to link directories on any current UNIX, and calling the link(2) system call from a process running as root, which will probably work on any current UNIX. How do you think that systems without the mkdir() system call create directories? They first call mknod() to make a directory node, and then call link twice, once to link "." to the new directory node, and again to link ".." to the parent node. This is why programs that make directories on such systems either have to run suid to root, or fork the /bin/mkdir program, which is suid to root. ====================================================================== Script started [typescript] at Wed Sep 6 20:09:24 1989 estinc:1610> cd /tmp estinc:1611> ls -laid /tmp 19 drwxrwxrwx 2 bin bin 624 Sep 6 20:09 /tmp estinc:1612> ls -laid / 2 drwxr-xr-x 18 bin bin 544 Aug 25 11:53 / estinc:1613> ls -lai /tmp total 194 19 drwxrwxrwx 2 bin bin 624 Sep 6 20:10 . 2 drwxr-xr-x 18 bin bin 544 Aug 25 11:53 .. Script ended [typescript] at Wed Sep 6 20:10:10 1989 ====================================================================== Note that /tmp is inode 19 with two links and / is inode 2 with 18 links (which include links for ".." in all the subdirectories, and "." and ".." in / itself, yes / is special with respect to ".."). Inside /tmp, "." is linked to /tmp and ".." is linked to root. P.S. This is my last posting on the subject, since we really are digressing from the amiga... -Fred -- # Fred Fish, 1835 E. Belmont Drive, Tempe, AZ 85284, USA # 1-602-491-0048 asuvax!{nud,mcdphx}!estinc!fnf