From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-31 06:02:22
Beman Dawes wrote:
> At 05:28 PM 3/30/2005, Peter Dimov wrote:
>> Martin wrote:
>>> - non-throwing is_* functions. I find it very inconvenient and error
>>> prune to put try/catch around each is_directory call. Calling
>>> is_accessible before every other is_* function is an option but not
>>> much easier and still leaves a risk for an exception if another
>>> process is accessing the file.
>> Did is_accessible get added, after all?
>> That's bad. Let's remove it before
>> it gets standardized and it's too late. :-)
It is a hack. Only "useful" on Windows, and only because of implementation
details. It is not clear what is_accessible actually does, or why it should
be used. It is not referenced anywhere else. The implementation does not
reflect the description; on Windows it maps to GetFileAttributes and returns
false if that fails, but for some "inaccessible" files it is possible to
obtain the attributes using FindFirstFile.
The latter is particularly relevant in directory iteration loops; every item
in such an iteration is "accessible" because the act of iteration gives you
the attributes on our supported platforms. Yet is_accessible returns false
for some of the items.
I may be wrong, of course.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk