
9 May
2005
9 May
'05
1:27 p.m.
Beman Dawes wrote:
But if stat() doesn't report both S_ISDIR and S_ISREG true at the same time, there isn't any way to practically implement status(), even if you buy the argument that reporting both would be desirable.
S_ISREG is is_regular_file, not is_stream. /dev/urandom is not a regular file, but it is a stream, IIUC (a "character special file", probably, I don't have a POSIX system at the moment handy). is_file specification aside, an implementation of the standard library is not required to be portable, so it can exploit whatever platform-specific information it wants, unless you want to _specifically disallow_ this in the specification of status().