Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!amdcad!sun!gorodish!guy
From: guy@gorodish.UUCP
Newsgroups: comp.unix.wizards
Subject: Re: stupidity in directory management?
Message-ID: <23047@sun.uucp>
Date: Thu, 9-Jul-87 13:35:59 EDT
Article-I.D.: sun.23047
Posted: Thu Jul  9 13:35:59 1987
Date-Received: Sun, 12-Jul-87 01:45:03 EDT
References: <603@nonvon.UUCP>
Sender: news@sun.uucp
Distribution: na
Lines: 22

> Am I mistaken about the way directories are arranged, about identifying
> rm-ed entries?

Yes.  In the V7 file system, as used by most UNIX versions, directory
entries are all the same size, and it's trivial for the OS to reuse
the slots formerly occupied by entries that have been freed.  In
fact, it does so.  Either your vendor has screwed up royally - which
is extremely unlikely, since few people dink with that code - or
you're misinterpreting something.

In the 4.2BSD file system, directory entries are not the same size,
but the OS still reuses the space occupied by freed entries as best
it can; it will compact directory blocks as needed, shuffling entries
to make discontiguous unused areas contiguous.

Now, if you fill up a directory with lots of files and then delete
the files, in most versions of UNIX the directory will still be the
same size, although most of the space will be free.  In 4.3BSD, the
OS will shrink the directory file under certain circumstances.
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com