Date: Wed, 23 May 2012 03:27:50 -0500 (CDT) From: Robert Bonomi <bonomi@mail.r-bonomi.com> To: freebsd-questions@freebsd.org Subject: Re: hard link identification Message-ID: <201205230827.q4N8RopZ089148@mail.r-bonomi.com>
next in thread | raw e-mail | index | archive | help
Devin Teske <devin.teske@fisglobal.com> wrote: > > On May 22, 2012, at 2:26 PM, Robert Bonomi wrote: > > > <dteske@freebsd.org> wrote; > >> > >> For directories, the link-count is quite obviously the number of filesystem > >> entities contained within. > > > > That is *INCORRECT*. > > Details. > > The OP wanted to know about files. I chose to not elaborate on the > directory-case of the value (as it was not important to the OP). FACT: The count for a directory is _NOT_ the number of "filesystem entities" containted within, as you claimed. (Unless your notion of a 'filesystem entry' excludes (1) regular files, (2), named pipess, (3) device nodes, (4) unix sockets, (5) symlinks, AND everything else, _except_directories_, that appear as entries in a directory.) Tell me, according to your claim that "for directories, the link-count is quite obviously the number of filesystem entities contained within", just _approximately_, what is the expected link count for a directory containing 135 regular files, 9 'dot files' (including '.' and '..'), and 26 sub- directories? No need for an exact answer. Just pick one -- do you claim the number is going to be close to 26, or to 170? The 'details' of the link count for a directory became significant only when someone posted grossly incorrect information about what that number "meant". A 'name' inside a directory points to an 'inode'. the inode has a count of how many 'names' point to that inode. It doesn't make NOT ONE D*MN BIT of difference whether the contents of that inode are a directory, a regular file, a symlink, or whateverC -- the 'link count' has always exactly the same meaning.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205230827.q4N8RopZ089148>