bug-coreutils
[Top][All Lists]
Advanced

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

Re: ln can't backup directories


From: Jim Meyering
Subject: Re: ln can't backup directories
Date: Sun, 13 Sep 2009 13:00:58 +0200

Bert Wesarg wrote:
> On Fri, Sep 11, 2009 at 16:15, Jim Meyering <address@hidden> wrote:
>> cp and mv work the same way: even with --backup, they refuse to move
>> aside a destination directory.
> Which does not seem to be correct, mv backups target directories:
>
> $ mkdir a b
> $ touch c
> $ \mv --no-target-directory --backup=numbered b a
> $ \mv --no-target-directory --backup=numbered c a
> $ \ls
> a  a.~1~  a.~2~
> $
>
> But mv could not be used for the backup() alias:
>
> $ \mv --no-target-directory --backup=numbered a a
> mv: `a' and `a' are the same file
> $ \mv --no-target-directory --backup=numbered -f a a
> mv: `a' and `a' are the same file
>
>> Maybe someone will volunteer to do the work.
>>
> However, the trivial patch below solves the case for cp and ln and
> still passes the test suit:
>
> ---8<---
> Subject: [PATCH] cp, ln: backup target directories

Hi Bert,

Thanks for the patch!
I'll review it Monday or Tuesday.
In the mean time, do you feel like writing the remaining
parts of such a change?

  - mention this in NEWS: put it under Changes in behavior or Improvements

  - add tests of cp and ln that exercise the new behavior, i.e.,
  that fail with the current/old tools and pass with your changes

  - possibly adjust doc/coreutils.texi




reply via email to

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