Reading directories
Kyle Jones
kjones at talos.UUCP
Tue Oct 25 00:37:30 AEST 1988
In <331 at talos.UUCP> kjones at talos.UUCP (Kyle Jones) writes:
>It is clear why directories should not be arbitrarily writable but I
>don't see any such reason why they shouldn't be readable. The portable
>directory reading routines could use the existing read(2) system call,
>instead of adding (yet another) system call just to read directories.
In <744 at sequent.cs.qmc.ac.uk> liam at cs.qmc.ac.uk (William Roberts) writes:
>This is too narrow a view in the world of networks and
>distributed systems - the "portable directory routines" exist
>so that the code *above* them is portable, not so that the
>routines themselves are portable.
I didn't say that the portable directory reading routines needed to be
portable. I questioned the need for these ruotines to have to use
another UNIX system call *just* to read directories when UNIX file
semantics make it possible to use an existing system call. (And
behold, what does getdirentries(2) do but fill a buffer, just as
read(2) does?)
If I can use read(2) to get input from something as idiosyncratic as a
teletype, why can't I (or the portable directory reading routines) use
it to read directories? Wouldn't it have been just a simple to make
read(2) (when reading a directory) fill the buffer pointed to by its
second argument with the same information that the getdirentries(2)
call provides?
kyle jones <kjones at talos.UUCP>
More information about the Comp.unix.wizards
mailing list