
"Rob Stewart" <stewart@sig.com> wrote in message news:200504011513.j31FDSs10439@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