|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2004-09-10 14:47:33
At 02:19 PM 9/10/2004, Peter Dimov wrote:
>Beman Dawes wrote:
>> An attempt to query the attributes, such as
>> is_directory("pagefile.sys") would throw an exception, which can be
>> avoided by checking is_accessible("pagefile.sys").
>
>I'm not sure why would anyone want to omit the is_accessible check before
>calling is_directory.
In software which is specified to cope with even rare eventualities without
recourse to a general error catch, it probably shouldn't be omitted.
In applications which run in a very controlled and tightly specified
environment, anything not being accessible is virtually certain to be an
error condition, so just letting is_directory() throw is best for those
apps.
Another question is which other query functions also need to be protected
by an is_accessible() test in some applications?
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk