From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-05-11 19:24:45
"Mathew Robertson" <mathew.robertson_at_[hidden]> wrote in message
>> Sure, but it seems like you can only use that facility on a system you
>> already have prior knowledge about. Part of that knowledge could come
>> ::stat(), either directly or wrapped in a call to
> Yes that knowledge _could_ come from status(), but for platforms that dont
> support the named property, the implementation should return something
> useful as a fallback.
> However, is_blah() should "do the right thing" on platforms which dont
> support 'blah'
And we have done that where the "right thing" is obvious, such as "false"
for is_symlink() on Windows. I'm not against adding more such "do the right
thing" functions when we can figure out what the "right thing" is.
>> But if stat() doesn't report both S_ISDIR and S_ISREG true at the same
>> there isn't any way to practically implement status(), even if you buy
>> argument that reporting both would be desirable.
> sure there is... dont use stat() ...
Somehow query for the file system in use, and have a table of what file
systems support reading directories? Try to open a known directory for
Those don't seem practical to me. But stat() may give the correct results on
at least some systems. I'll try Apple OS X to see what happens.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk