This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Do we really need correct st_nlink count for directories?


On Apr 25 21:24, Eric Blake wrote:
> According to Igor Peshansky on 4/25/2008 2:25 PM:
>>> When link counts are accurate, every directory has a link count of at
>>> least 2 (. and ..)
>> I thought leaf directories had a legitimate link count of 1.
>
> Two, actually: ".", but also the entry in ".." that points to the 
> directory's inode.  There might be some alternative file systems where 
> readdir() omits . and .. in its list, leaving a link count of 0.  But I've 
> never seen a disk-based link count of 1.  And even Linux uses 1, not 0, as 
> the link count of FAT directories.

...and of NTFS dirs as well, FWIW.  In case of Windows, it's the actual
link count returned by the OS functions.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]