S
Sensei
I was having an interesting discussion about the ANSI C and some
``weird inconsistencies'', or at least what at first sight can be seen
as an imbalance. I hope someone can satisfy my curiosity.
The standard provides means to open files associating a /path/ with a
/stream/. The standard does not provide any means to handle
/directories/. There are three streams defined by the standard, stdin
stdout stderr. Am I right?
Now, what is the reason for /not/ defining the directory counterparts
for files (something like fopen, with a directory dopen)?
We know that there exist platforms (e.g. on firmwares) where we can
hardly use ``files'' (with /paths/) while we can play with the three
standard std* /streams/. Paths of files are highly system dependent
just like directories. Files on the other hand are more likely to exist
on many platforms, or at least it seems to us.
Is there any reason? Is the standard going to change? Are directories
treated as normal files?
I know it might be a stupid question, but I'm curious about the history
behind choices
Thanks!
``weird inconsistencies'', or at least what at first sight can be seen
as an imbalance. I hope someone can satisfy my curiosity.
The standard provides means to open files associating a /path/ with a
/stream/. The standard does not provide any means to handle
/directories/. There are three streams defined by the standard, stdin
stdout stderr. Am I right?
Now, what is the reason for /not/ defining the directory counterparts
for files (something like fopen, with a directory dopen)?
We know that there exist platforms (e.g. on firmwares) where we can
hardly use ``files'' (with /paths/) while we can play with the three
standard std* /streams/. Paths of files are highly system dependent
just like directories. Files on the other hand are more likely to exist
on many platforms, or at least it seems to us.
Is there any reason? Is the standard going to change? Are directories
treated as normal files?
I know it might be a stupid question, but I'm curious about the history
behind choices
Thanks!