Muli Ben-Yehuda wrote:
>On Sun, Jul 14, 2002 at 10:59:05AM +0200, Iftach Hyams wrote:
>
>
>> I am looking for the "highest lavel" call to indicate if a file is hard
>>linked (and later where are the over links in a given
>>subdirectory). Currently the file system is ext2 but I prefer to
>>do it general.
>>
>>
>
>To see how many hard links a file has, man stat, specifically, the
>st_nlink member of the stat buffer.
>
>To see which file names are hardlinks for it is an interesting
>problem, and I'm not aware of any way to do it, short of a complete
>file system scan. Anyone?
>
>
Don't think there is. The only way I know is to scan the rest of the
filesystem, and look for all the files that have the same inode number.
In theory, you can stop when you have reached the same number as
returned by nlink, but there are cases where this will fail miserably,
just as there are cases where you will not find all the files.
Shachar
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]