From owner-freebsd-questions@FreeBSD.ORG Wed May 23 08:26:00 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A2FE106566B for ; Wed, 23 May 2012 08:26:00 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id 37F4A8FC19 for ; Wed, 23 May 2012 08:25:59 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id q4N8RopZ089148 for freebsd-questions@freebsd.org; Wed, 23 May 2012 03:27:50 -0500 (CDT) Date: Wed, 23 May 2012 03:27:50 -0500 (CDT) From: Robert Bonomi Message-Id: <201205230827.q4N8RopZ089148@mail.r-bonomi.com> To: freebsd-questions@freebsd.org Subject: Re: hard link identification X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 08:26:00 -0000 Devin Teske wrote: > > On May 22, 2012, at 2:26 PM, Robert Bonomi wrote: > > > 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.