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: Fri, 11 Sep 2009 17:10:18 +0200

Bert Wesarg wrote:
>>>>> Thanks to all for the release. But can someone please have a look at my 
>>>>> problem?
>>>>
>>>> cp and mv work the same way: even with --backup, they refuse to move
>>>> aside a destination directory.
>>>>
>>>> However, that's something that I've considered worth changing
>>>> for years.  I never got around to it.  If only for the testing
>>>> requirements, it will not be a trivial change, since for UI
>>>> consistency, it should affect all three at the same time.
>>>>
>>>> Maybe someone will volunteer to do the work.
>>> Maybe a simpler solution would be a new dedicated tool which just
>>> backups files, i.e. utilize the find_backup_file_name()/rename()
>>> combination and call it 'mkbck'.
>>
>> We already have that ;-)
>> Here's a bash "function" named backup:
>>
>> backup() { local i; for i in "$@"; do command cp -bf "$i" "$i"; done; }
> Which still does not work for directories?

Correct.  It uses the same underlying code.

My point is that making the tools do what I suggest
will give you the tool (that alias) you'd like.
No need to duplicate all of copy.c.




reply via email to

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