rename strangeness, a possible bug

Conor P. Cahill cpcahil at virtech.UUCP
Sun Aug 27 02:18:31 AEST 1989


In article <Aug.25.20.08.36.1989.12245 at pilot.njin.net>, deastman at pilot.njin.net (don eastman) writes:
> I don't believe there is a compelling reason (except as forbidden by
> permissions) to restrict mv from moving a directory to a new location
> within the same file system. If the target location was to another
> directory, you would however have to check that the file system hasn't changed.
> Their added restriction just avoids having to check.

Moves of directories are real bad things that can open lots of cans of
headaches.   One of them is what happens when you move a directory to a
sub-directory of itself.  Consider the following:

	directory structure:	/a/dir1/dir2/dir3/dir4/dir5

		command:	mv /a/dir1 /a/dir1/dir2

		command:	(in /a/dir1/dir2) mv .. dir3k
	
Another problem is (due to the fact that the move will not be and atomic 
operation) what happens if the command is interrupted (with a kill -9, so
it doesn't have a chance to clean up)?  Do we now have a corrupted file system?

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.wizards mailing list