On Fri, 29 Sep 2000, Andrew Brown wrote:
# it seems that a file can replace a file by the same name and a
# directory can replace an *empty* directory by the same name. this
# means that the following command will work twice, but not three times.
#
# % cd /tmp ; mkdir -p foo/bar ; mv foo frotz
#
# i was surprised when i saw that it worked twice.
...why?
1. rename foo to frotz. Straight up, since frotz didn't exist.
2. rename foo to frotz/foo, since frotz/foo didn't exist before.
3. Fails because frotz/foo exists and is not empty. It's not trying
to clobber frotz directly.
Seems very UNIX-like to me :-)
--*greywolf;
--
BSD: the devil made me do it.