|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-12-01 14:51:49
Jeremy Maitin-Shepard wrote:
> Beman Dawes <bdawes_at_[hidden]> writes:
>
>>> unsigned int link_count(path const &ph);
>>>
>>> Returns the number of hard links to the file specified by the
>>> argument. (On platforms that do not support hard linking, this
>>> always
>>> returns 1.) Throws if the path does not exist or is inaccessible.
>
>> What are some use cases for this function? Do they degrade
>> gracefully on platforms which don't support hard linking? Do they
>> degrade gracefully on platforms which support hard linking on some
>> file systems and not
>> others?
>
> The use case is programs like tar or du -- a typical use is to store a
> unique identifier in a hash table for each file with a link count
> greater than 1, so that the file is only backup up (in the case of tar)
> or counted (in the case of du) once.
You need an "unique identifier" function (inode?) for this, not a "link
count" function. ;-)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk