bug-coreutils
[Top][All Lists]
Advanced

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

Re: cp -u should skip copying a file to itself


From: Jim Meyering
Subject: Re: cp -u should skip copying a file to itself
Date: Sun, 05 Oct 2008 18:31:31 +0200

Ed Avis <address@hidden> wrote:
> % touch foo foo
> % cp -u foo foo && echo yes
> cp: `foo' and `foo' are the same file
>
> I expected that since -u says
>
>        -u, --update
>               copy only when the SOURCE file is newer than the
>               destination file or when the destination file is missing
>
> it would not attempt to copy the file in this case (since the file is
> not newer than itself) and cp would return a true exit status.

Sounds like it'd be worthwhile to change that, if you can do it
in an obviously safe manner.  If you write a patch, please
follow the guidelines in HACKING:

  http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=blob;f=HACKING;hb=HEAD




reply via email to

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