On 11/25/11 5:54 PM, Markus Wichmann wrote:
....
Yeah, that appears to be quite stunning. To my knowledge, any OS out
there with multitasking capabilities should have a file system. Or are
there counter examples?
....
HTH,
Markus
The question comes, do they all support them is a close enough manner
that a usable portable definition could be defined if the standard
extended the current file primitives to directories.
We do already have a POSIX standard which defines this for one major
class of systems. It would NOT make sense to just adopt that for C, as
then suddenly OSes that are NOT POSIX compatible might have a hard time
implementing the standard.
There is nothing wrong in using standards beyond the C standard in
defining your program (as long as they are compatible with it, and you
environment supports it).
This currently means that if you want to use <dirent.h>, you just need
to document that you program requires C/POSIX not just C as the
environment. This also means that you have available everything that
POSIX supplies. If the C standard did adopt a directory library you
would probably be complaining that it doesn't provide enough capability,
as it would be less than what you get from POSIX, and likely to remain
backwards compatible, (avoiding gratuitous incompatibilities with the
POSIX standard), the include file would likely be given a different name
and the functions would have different names.