[Top][All Lists]

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

Re: cp/mv: add -n option to not overwrite target (Ubuntu bug #229182)

From: Kamil Dudka
Subject: Re: cp/mv: add -n option to not overwrite target (Ubuntu bug #229182)
Date: Wed, 7 Jan 2009 16:39:55 +0100
User-agent: KMail/1.9.6 (enterprise 0.20071012.724442)

On Wednesday 07 January 2009 08:35:24 Jim Meyering wrote:
> Have you considered other long-option names?
> I prefer --no-clobber.  or maybe --no-overwrite
In this case I prefer --no-overwrite, but feel free to change it.

> -----------------------
> Please adjust the NEWS entry:
> -  cp/mv new option -n to not overwrite target
> +  cp and mv accept a new option, --LONG_OPTION (-n): silently refrain
> +  from overwriting any existing destination file
> -----------------------------
> You haven't mentioned how this new option interacts with --backup,
> another option that prevents loss of any existing destination file.
> Since with --backup, cp and mv arrange to move any destination aside,
> one might expect -n --backup to be equivalent to --backup.
The behavior is the same as for -i option with negative user's response. If 
nothing is going to be overwritten, there is nothing to backup. I think this 
is an expected behavior and in this way is the --backup option already 

> -------------------
> In mv documentation (--help and texi), please say something like:
>   If you specify more than one of the -i,-f,-n options, only the
>   final one takes effect.
> That's easier to understand than
>   -i overrides preceding -f or -n
>   -n overrides preceding -i or -f
>   -f overrides preceding -i or -n
Yes, it makes sense. The current description was taken from FreeBSD man pages 
for cp/mv.

Attaching new version of the patch.


Attachment: 0001-cp-mv-add-no-overwrite-n-option-to-not-overwri.patch
Description: Text Data

reply via email to

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