|
Boost : |
From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-03-16 20:05:17
"Jeremy Maitin-Shepard" <jbms_at_[hidden]> wrote in message
news:878yi09w29.fsf_at_jbms.ath.cx...
> Making it handle symbolic links properly is certainly not trivial,
and
> cannot be done efficiently with the current version of the
filesystem
> library (assuming no additional platform-specific code is added).
>
> As has been discussed already in relation to the implementation of
the
> `equivalent' function which Beman is adding, the common
implementation
> is to store the inode numbers of every directory with a link count
> greater than one in a hash set, and then make sure that they are
> traversed only once. This implementation is not perfect, however,
> because most platforms, including Windows and Linux, do not
guarantee
> that inode numbers are unique for files for which there is not an
open
> handle. Thus, the way to remedy this would be to keep an open
handle to
> each directory whose inode number is being stored; but this creates
the
> problem of the traversal being limited by the number of open file
> handles/descriptors a single process can have.
I understand the reluctance to add a feature which raises such thorny
issues. However, I think the fact that recursive directory iteration
is hard to implement properly is an excellent reason to put it in a
library. I would imagine that a lot of existing code doesn't handle
all these issues correctly. Limitations of the implementation can be
explained in the documentation.
Jonathan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk