Subject: Re: Linux emulation and mkdir with trailing /
To: Greywolf <greywolf@starwolf.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 09/29/2000 02:48:39
>#    % 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.

sure.  easy.

>2.	rename foo to frotz/foo, since frotz/foo didn't exist before.

well, yes.  but you're still only explicitly saying "mv foo frotz".
you're *not* explicitly saying "mv foo frotz/foo".  the fact that it
works is the part that makes some people think everything's fine...

>3.	Fails because frotz/foo exists and is not empty.  It's not trying
>	to clobber frotz directly.

...when it's not.

>Seems very UNIX-like to me :-)

oh, yes.  quite.  but try explaining that to some people and they'll
just wander off, calling over their shoulder that you should just fix
the damn thing.

if something works once, that's great.  if it works more than once,
they expect it to work all the time.  two is not a factor.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."