Path: utzoo!attcan!uunet!cs.utexas.edu!know!samsung!emory!mephisto!bbn.com!mips2!mwarren From: mwarren@mips2.cr.bull.com (Mark Warren) Newsgroups: comp.unix.wizards Subject: Re: Hard links to directories: why not? Keywords: ln, directories, security... Message-ID: <1990Jul19.115622.14015@mips2.cr.bull.com> Date: 19 Jul 90 11:56:22 GMT References: <5222@milton.u.washington.edu> <6940@eos.UUCP> Organization: Bull HN Information Systems Inc. Lines: 28 In article <6940@eos.UUCP> jbm@eos.UUCP (Jeffrey Mulligan) writes: > >What should be the output of the last command of this sequence? > >mkdir dir1 >mkdir dir2 >mkdir dir1/a_directory >ln dir1/a_directroy dir2/directory_link >cd dir2/directory_link >cd .. >pwd > This sounds more mysterious than it is. When a_directory is created, its parent is dir1, and it stays there. When directory_link is created, all that happens is that the directory dir2 gets a new entry that names the same inode as a_directory. The a_directory inode is NOT changed (except that its reference count increases), so its parent is still dir1. So, pwd == dir1 in any unix I know of. -- == Mark Warren Bull HN Information Systems Inc. == == (508) 294-3171 (FAX 671-3020) 300 Concord Road MS820A == == mwarren@granite.cr.bull.com Billerica, MA 01821 ==