From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-04-07 03:26:46


Beman Dawes wrote:
> I agree to the extent that some of the cases when the current
> implementation throws can be eliminated. For example, is_directory()
> can safely be changed to return false rather than throwing in the
> case of a non-existant path. (And we would add a similar is_path()).
> But I just can't convince myself that silently swallowing an I/O error
> would be safe And given the
> plan to add a status() function which can provide error swallowing
> behavior, a
> programmer can get that behavior if really, really, required.

I find it much more natural for stat() to throw:

    attributes stat( path const & p );

because on error it can't return a valid value.

If you fix the original defect that directory iteration only gives names
without attributes, the use of is_directory in iteration loops will be
eliminated. We'll then be left with its other uses, which may be easier to
analyze.