directory access (was: xbbs features as request)

Root Boy Jim rbj at icst-cmr.arpa
Sat Jun 4 03:19:16 AEST 1988


   From: Doug Gwyn  <gwyn at brl-smoke.arpa>

   When McKusick wrote the original 4BSD directory access routines,
   he called the new directory entry structure "struct direct",
   even though it was radically different from what all UNIX systems
   had called "struct direct" up to that time....

   ... I believe I heard Berkeley say they would
   also switch to "struct dirent", and that calling it "struct
   direct" in the first place had been a mistake.

Your recollection is correct. Here is his message:

From: Kirk McKusick <mckusick%okeeffe at berkeley.edu>
Newsgroups: comp.std.unix
Subject: Re: Changed names in POSIX directory access library
Sender: std-unix at uunet.UU.NET
Reply-To: mckusick%okeeffe at berkeley.edu (Kirk McKusick)
Date: 11 Aug 87 19:33:34 GMT
Apparently-To: std-unix-list

Cc: hoptoad!gnu at cgl.ucsf.edu (John Gilmore), gwyn at brl.arpa (Doug Gwyn),
        utzoo!henry at sun.com (Henry Spencer),
        longway!jsq at uunet.UU.NET (John S. Quarterman),
        karels at okeeffe.berkeley.edu (Mike Karels)
From: mckusick%okeeffe at berkeley.edu (Kirk McKusick)

When I wrote the directory access routines I made a mistake in 
connecting them with the underlying implementation of the file
system. They clearly should work on an abstract directory
definition which may coincidentally be the same as the underlying
directory structure (as it is in 4.3BSD). As such, I fully agree
with the decision in the POSIX standard to create a new header
file <dirent.h> rather than using <sys/dir.h>. It is the intention
of CSRG to change the source code at Berkeley to <dirent.h>.

I do take exception to the apparently gratuitous change of renaming
`d_ino' to `d_fileno' in the System V interface, though this can be
worked around with a #define.

	Kirk McKusick
	mckusick at berkeley.edu
	ucbvax!mckusick

Volume-Number: Volume 12, Number 9

As for his disagreement about d_ino/d_fileno, I think the idea here was
to disassociate the idea of a (UNIX specific) inode from the idea of a
generalized file handle. And of course, defines work both ways.

	(Root Boy) Jim Cottrell	<rbj at icst-cmr.arpa>
	National Bureau of Standards
	Flamer's Hotline: (301) 975-5688
	The opinions expressed are solely my own
	and do not reflect NBS policy or agreement
	My name is in /usr/dict/words. Is yours?



More information about the Comp.unix.wizards mailing list