lstat64("/b", 0xbffff280) = -1 ENOENT (No such file or
directory)
rename("a", "/b") = 0
Okay, after looking at the code again, this makes more sense. The copy
routine doubles as a rename command if in move_mode, hence the
"rename_successful" variable.
Paul Eggert wrote:
> Brendan Byrd/SineSwiper <address@hidden> writes:
>
>>I hashed out a patch for mv which is more or less the opposite of the
>>"--symbolic-link" option for cp. Instead of creating symlinks on the
>>destination before the copy, it creates symlinks on the source after
>>the move.
>
> Before we talk about the patch itself (which was not enclosed in your
> email, by the way), could you give an illustration why such an option
> is useful? Often the most important part of such changes is the
> documentation, and the illustration should be put there.
Hmmm...it was in an attachment, according to my Sent file. I guess the
mailing list doesn't support attachments. I could sent it in the
e-mail, but I'm afraid that long lines would get word wrapped. Is there
a place to send attachments/patches?
Sorry, I did forget about the man page, but I can easily add that in.
(The mv --help was changed, though.) I just wanted to release the patch
to see if the idea would be applied. As far as application and
usefulness, three things come to mind:
1. Retaining glob information during a mv/ln. This was my itch to
stratch. I wanted to move IRC *.log files to /var/log/ircd and then
link those to the moved files. Unforunately, after you move them, you
can't just type "ln /var/log/ircd/*.log ." if there are log files
already in the directory other than the ones you move. With the mv -s,
all of the glob information is retained, so it knows exactly which files
get the symlinks.
2. Moving directories from one filesystem to another. A common way of
shifting HD space on a multi-partitioned system is to move a large
directory from the full partition, to area owned by partition with space
to spare, followed by symlinking to the directory. This is made easier
with a "mv -s" command.
3. Better compatibility/completeness with the cp command. In comparison
to the cp command, the mv command is bereft of options. It's probably
true that the cp command has a bunch of little used or legacy options,
but this was one that I thought would have been added to mv already.
--
Brendan Byrd/SineSwiper <address@hidden>
Computer techie, Perl hacker, and all-purpose Internet guru
Resonator Software (http://www.ResonatorSoft.org/)