How is the UNIX directory set up?

Starman gaines at mars.njit.edu
Sat Feb 9 03:11:01 AEST 1991


Hi,
	I'm working on reading in the directory from the . file. I've
broken up the structire so far as follows:

Bytes 0-3 : file number
Bytes 4-5 : File type
Bytes 6-7 : filename length

So far it's been working real well, except that at the end of one filename
is the name of a file that's been deleted. The filename string is on a four
word boundry and the 'extra' filestring is 5 chars long. I understand if
there was an extra two or three bytes to make up for the 4word boundry,
but why five characters? An exaple:

alias.raycast0goofs00000   the zeros are '/0's.

My first assumption was that filenames are on an eight word boundry
rather than 4 word, but I have filenames 12 characters long total. The
filename 'goofs' should not be in there.

Also, there is
one deleted file that has a four byte header rather than the eight byte (it
has bytes 4-7) and other deleted files have the full eight byte
headers. Any help?

===========================================================================
"They can fly rings around the moon,	      |		 Mike
but we're years ahead of them on the highway" |	  gaines at mars.njit.edu
===========================================================================



More information about the Comp.unix.programmer mailing list