Subject: Re: Linux emulation and mkdir with trailing /
To: NetBSD Kernel Technical Discussion List <>
From: Andrew Brown <>
List: tech-kern
Date: 09/29/2000 00:26:26
>Perhaps it's just a learned expectation that "mv foo bar/" will rename
>"foo" to "bar" if there's no pre-existing directory "bar", but I
>personally am not surprised in any way by that happening.

fwiw, this particular case (and "install myprogram /usr/local/bin/"
from alan barrett) can be made to work the way some people expect by
changing mv and install slightly.  they could be taught to look for
trailing slashes and if they exist, simply append the last component
of the source argument.  eg:

   mv foo bar/ -> rename("foo", "bar/foo")
   install myprogram /usr/local/bin/ -> ..."/usr/local/bin/myprogram"

which *will* fail if the last component in the target path does not
exist as a directory.

you get the idea.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."