<[email protected]> wrote; > > For directories, the link-count is quite obviously the number of filesystem > entities contained within.
That is *INCORRECT*. The link-count on a directory is the number of dir- ectory entries (file names) tht resolve to it, just as with any other file. The count starts at *TWO* -- one for the directory name itself, plus one for the '.' self-refernce 'in' that directory -- plus one for the '..' reference in each and every sub-directory that is in that directory, PLUS one (albeit rare) for any other hard-linked names that also resolve to that diretory. To wit: $ mkdir foo # 'ls -l foo' will show a link-count of 2 $ touch foo/bar # 'ls -l foo' will show a link-count of 2 $ mkdir foo/baz # 'ls -l foo' will show a link-count of 3 $ ln -s foo foo2 # 'ls -l foo' will show a link-count of 3 $ ln foo quux # 'ls -l foo' will show a link-count of 4 _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
