Xref: utzoo comp.unix.questions:8207 comp.unix.wizards:9888 comp.sys.apollo:1118
Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!amdahl!pacbell!att!whuts!picuxa!gpasq
From: gpasq@picuxa.UUCP (Greg Pasquariello X1190)
Newsgroups: comp.unix.questions,comp.unix.wizards,comp.sys.apollo
Subject: Re: File space allocation/deallocation under Unix (BSD4.x)
Keywords: Unix, BSD, File, Delete
Message-ID: <624@picuxa.UUCP>
Date: 13 Jul 88 13:11:50 GMT
References: <9662@eddie.MIT.EDU>
Reply-To: gpasq@picuxa.UUCP (Greg Pasquariello X1190)
Organization: AT&T/EDS Product Integration Center
Lines: 22

In article <9662@eddie.MIT.EDU> rich@eddie.MIT.EDU (Richard Caloggero) writes:
>
>
>     If you create a directory "d", then create a file "d/f" 1 megabyte
>long (big), then "rm d/f", is it true that the space remains allocated
>to directory "d" and cannot be garbage collected or otherwise reclaimed
>until another file is created in directory "d" or "d" is deleted?  If this is true, why?
>-- 
>						-- Rich (rich@eddie.mit.edu).


No, this is not true.  What really happens is the inode is removed (thereby
"freeing" the disk space), but the filename remains in the directory (which
is really just a file with special permissions that holds other file names
and i-numbers).  The i-number in the directory entry is zeroed, signifying
a free slot in the directory.  When a new file is created in that directory,
any free slots are used for the new name and i-number rather than adding onto
the directory file itself.
-- 
=========================================================================
Greg Pasquariello                   AT&T Product Integration Center
att!picuxa!gpasq                299 Jefferson Rd, Parsippany, NJ 07054
=========================================================================