bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for "mv -s" option


From: Brendan Byrd/SineSwiper
Subject: Re: Patch for "mv -s" option
Date: Mon, 22 Nov 2004 06:37:56 -0500
User-agent: Mozilla Thunderbird 0.7.2 (Windows/20040707)

Paul Jarc wrote:
Brendan Byrd/SineSwiper <address@hidden> wrote:

address@hidden:~/tmp/a> mv -s b/f .
mv: `b/f': can make relative symbolic links only in current directory

Does "mv -s b/f b/.." work?

address@hidden:~/tmp/a> mv -s b/f b/..
mv: `b/f': can make relative symbolic links only in current directory
address@hidden:~/tmp/a> mv b/f .
address@hidden:~/tmp/a> cp -s f b
cp: `b/f': can make relative symbolic links only in current directory
address@hidden:~/tmp/a> mv f b
address@hidden:~/tmp/a> cp -s b/f b/e
cp: `b/e': can make relative symbolic links only in current directory
address@hidden:~/tmp/a>

No, it doesn't work, but it doesn't work with "cp -s" either.

> If not, I'd think that case (where the
destination starts with all the same path components as the source
file, up to the source's basename) could be made to work without too
much extra effort.  It would be equivalent to:
cd "$(dirname "$1")" && mv -s "$(basename "$1")" "${$2/$(dirname "$1")/}"

Maybe, but I'm not sure how to code this in the subroutine. (Sorry, this was mostly a copy&paste job, and C isn't exactly my forte.)

I think my main point is that this is not a serious limitation, or at least one that was never brought up until now. It's apparently been in the copy.c code for eons. There must be some reason for this limitation to be put in place since somebody spend some amount of time writing a somewhat complex routine JUST to check for a non-current directory condition.

If we are to remove this check, we need to figure out the reason for the check, see if it applies now, or see if there's a fix for it. I understand the need for the fix, though I'm hesistant to apply it until we can check to see if the author of the original copy.c code (for the "-s" patch) found some odd case that we don't know about. (Any notes in the CVS history during this patch?)

I think it might be better to keep the check in place for now, and use a second patch to fix the other problem, since it also exists in copy.c. I'll create another ML thread for this.

BTW, were there any other problems with the patch?

--
Brendan Byrd/SineSwiper <address@hidden>
Computer techie, Perl hacker, and all-purpose Internet guru
Resonator Software (http://www.ResonatorSoft.org/)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]