Path: utzoo!utgpu!attcan!uunet!husc6!cmcl2!rutgers!att!pacbell!rtech!gonzo!daveb From: daveb@gonzo.UUCP (Dave Brower) Newsgroups: comp.unix.wizards Subject: Re: Reading directories (was: Re: directory copying with cp; broken?) Message-ID: <438@gonzo.UUCP> Date: 17 Oct 88 04:12:55 GMT References: <30506@bbn.COM> <884@yabbie.rmit.oz> <331@talos.UUCP> Reply-To: daveb@gonzo.UUCP (Dave Brower) Organization: Gonzo Media Group Lines: 20 In article <331@talos.UUCP> kjones@talos.UUCP (Kyle Jones) writes: >In article <884@yabbie.rmit.oz> rcodi@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