GNU bug report logs -
#6023
cp: Make --backup the default
Previous Next
Reported by: Salvador <salvador.mazza33 <at> gmail.com>
Date: Sat, 24 Apr 2010 10:32:05 UTC
Severity: wishlist
Tags: moreinfo
Merged with 6022
Done: Bob Proulx <bob <at> proulx.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Bob Proulx <bob <at> proulx.com> wrote:
> Salvador wrote:
> > Salvador wrote:
> >> I want to request a feature for the Cp command that consist in
> >> renaming a file from the source when a file in the destination
> >> directory with the same name already exists. I am thought It could
> >> be something like: from file.jpg to file-1.jpg. This behavior
> >> already exists in Web browsers and file managers. Thanks.
> > Also, I know about the backup argument but it makes the file not
> > being possible to use by some programs without being renamed.
>
> As you say the feature already exists with 'cp --backup[=CONTROL]' and
> therefore you already have that behavior available to you. If I
> understand what you are saying then you are asking for it to be made
> the default behavior.
I think what he wants is for the backup mechanism to preserve an
existing suffix on the filename by inserting the versioning token
somewhere in the middle of the filename.
Salvador: That's a tricky proposition. How do you know _where_ to put
the token? Figure out a good algorithm for determining how to rename
each of these files, starting with the easiest case and moving on from
there. Note that while I picked a couple of these to monkeywrench your
specific example above, any similar system will be susceptible to
similar weaknesses.
somepic.jpeg
package_sources.tar.gz
document_part_1-1.odt
document_part_1-2.odt
Song no. 7.mp3
some.people.really.name.files.like.this
alsolikethis
--
There are problems in today's world that cannot be
solved by the level of thinking that created them.
-- Albert Einstein
This bug report was last modified 14 years and 210 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.