Reading directories (was: Re: directory copying with cp; broken?)

Dave Brower daveb at gonzo.UUCP
Mon Oct 17 14:12:55 AEST 1988


In article <331 at talos.UUCP> kjones at talos.UUCP (Kyle Jones) writes:
>In article <884 at yabbie.rmit.oz> rcodi at yabbie.rmit.oz (Ian Donaldson) writes:
>>So what's the problem with disallowing opening directory special files 
>>generally?
>
>It violates the UNIX principle of `a file is a file is a file...'.  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.

The problem that is fixed by having system call directory access rather
than plain ol' read(2) is this:  What do you do when you have a
filesystem  type, presumably imported from some other OS, where
directories are *not* just files?  This struck the folks at AT&T like a
bullet when they introduced the files system switch (FSS) in V.3 (or was
it V.2?).  In particular, it is what would let you mount a VMS file
system and still be able to read the directories.

-dB



More information about the Comp.unix.wizards mailing list