Huge directories

D. Mathis dave at elandes.UUCP
Sun Nov 27 06:07:32 AEST 1988


In article <515 at auspex.UUCP>, guy at auspex.UUCP (Guy Harris) writes:
.
. gives a method for compressing directories
. 
.
> 1) Make sure nothing is running that could create new files in the
>    directory.
> 2) Make a new directory in the same parent directory as the directory
>    in question.
> 3) Move all the files from the directory in question into the new
>    directory.
> 4) Remove the now-empty directory in question.
> 5) Rename the new directory to have the same name as the just-removed
>    directory.


	When I have to do this operation, I 'move' the directory to a new
name, and make a new directory with the correct name as 'one' command. i.e.
$ mv oldname newname ; mkdir oldname

	The window of vulnerability seems small enough that I have never
seen a process fail for not having the 'correct' directory available.  It
also allows current processes to keep their files open, since the directory
name isnt part of the file descriptor.
	Then I move the files from newname to oldname and remove newname.

	Are ther problems with this sequence that I have just never been
bitten by?
-- 
	Dave Mathis, ELAN designs           UUCP  ...oliveb!elandes!dave



More information about the Comp.unix.questions mailing list