This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: using nlink value
- From: ericblake at comcast dot net (Eric Blake)
- To: cyg_win_user <sachin_chat at rediffmail dot com>, cygwin at cygwin dot com
- Date: Thu, 09 Mar 2006 13:59:08 +0000
- Subject: Re: using nlink value
>
> here ROOT is a directory which can be or can not be present in all test
> directories. so i test if nlink is three (3) and if that ROOT directory is
> present to see if the directory is leaf directory. if the ROOT is not
> present then i test if nlink is 2 ( for . and ..).
> this works fine with linux and solaris. but in cygwin i am not getting the
> same value of nlink as i m getting in linux.
If you are working on a local drive, use a snapshot (there have been bug
fixes on this front to make the link count reliable). But if you are on
a shared drive, where nlink is 1, it is because there is no efficient
way for cygwin to compute the link count, so you can no longer
use the link count as an optimization for finding leaf dirs - you
will manually have to stat every file in a directory with a link count
of 1 to count the number of subdirectories yourself.
--
Eric Blake
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/