Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-05-03 10:04:08

From: "Peter Dimov" <pdimov_at_[hidden]>
> Beman Dawes wrote:
> > I've completed an analysis of expectations for the exists() and
> > is_xxx() family of functions, and the previously suggested status()
> > and symlink_status() functions.
> >
> > See
> >
> One quick comment about status(). I don't like the fact that the user
> effectively has to read a global variable to obtain the error code. I'd
> prefer something along the lines of
> status_flag status( path const & p, int * error = 0 );
> or packing the error code in the return value.

I also thought about that. system_error_code() can certainly be
made threadsafe, and all commands can set a thread-specific error
code. But it does mean that it is easy to ignore problems in
calling status() and that one must read the error code before
calling it again.

Perhaps the flags could be accumulated with the error code in a
class that has a safe-bool conversion?

Rob Stewart                           stewart_at_[hidden]
Software Engineer           
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at, gregod at, cpdaniel at, john at