Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!gatech!ncar!tank!nic.MR.NET!uwmcsd1!marque!uunet!mcvax!ukc!eagle.ukc.ac.uk!icdoc!qmc-cs!liam From: liam@cs.qmc.ac.uk (William Roberts) Newsgroups: comp.unix.wizards Subject: Re: Reading directories Summary: rading directories is for the narrow minded Keywords: heterogeneity, NFS Message-ID: <744@sequent.cs.qmc.ac.uk> Date: 20 Oct 88 10:24:18 GMT References: <30506@bbn.COM> <884@yabbie.rmit.oz> <331@talos.UUCP> Reply-To: liam@cs.qmc.ac.uk (William Roberts) Organization: Computer Science Dept, Queen Mary College, University of London, UK. Lines: 35 Expires: Sender: Followup-To: Distribution: In article <331@talos.UUCP> kjones@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. 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. We have lots of grief because of programs which try to interpret directories via read(2), not noticing that they are actually coming from 1) a fileserver with a different byte ordering, e.g. a Sun mounted on a Sequent anything, 2) a different type of UNIX, e.g. an A/UX (== SysV.2.2) filestore mounted on a Sun (== BSD 4.2) 3) (God help us) a completely different kind of beast altogether, such as the NFS-served MacOS filesystem that we have here at QMC. The grief, incidentally, comes from the effect when the errant program fails to notice that its information is garbage - the server spends lots of time printing messages such as "NFS read request on non-file" on the console.... If someone out there is listening - please fix "tar" and "ranlib" so that they don't expect to use read(2) on directories, and furthermore, make *your* NFS implementation follow the rule that open(2)ing a directory is not permitted. -- William Roberts ARPA: liam@cs.qmc.ac.uk (gw: cs.ucl.edu) Queen Mary College UUCP: liam@qmc-cs.UUCP LONDON, UK Tel: 01-975 5250