Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-04-03 21:11:59


"Rob Stewart" <stewart_at_[hidden]> wrote in message
news:200504011513.j31FDSs10439_at_vanzandt.balstatdev.susq.com...
>
> I think a single, overloaded function can quite easily accomodate
> everything and still be easy to use:
>
> struct no_throw_t { };
> static no_throw_t nothrow;
>
> struct resolve_symlinks_t { };
> static resolve_symlinks_t resolve_symlinks;
>
> enum attributes { ... };
>
> attributes
> stat(path); // !resolves, throws
>
> attributes
> stat(path, no_throw_t); // !resolves, !throws
>
> attributes
> stat(path, resolve_symlinks_t); // resolves, throws
>
> attributes
> stat(path, resolve_symlinks_t, no_throw_t); // resolves, !throws

Yes, that should do the trick. Perhaps the default should be to resolve
symlinks, since that is how the POSIX stat() works and is perhaps the more
common need. But that isn't a strong argument, and in any case I think the
function should be named status() or attributes().

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk