There are some Unix versions which actually do that, and it sometimes
results in a desaster. For example, 'vi /tmp' ... hmm, strange
looking characters ... type garbage keys in panic ... ahh, ZZ finally
got me out ... oops, where is the /tmp directory, and why is the system
flooding me with messages that I should fsck?
Actually, open is not the problem - read and write is.
> How exectly does the opendir libr. routine work?
Depends on the operating system and the C library. You usually start
with open(2). In old Linux versions, you continue with readdir(2).
More recent libraries on more recent kernels use getdents(2) instead,
which returns more then one file name per call.
Hope this helps,
Martin