bug-coreutils
[Top][All Lists]
Advanced

[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: Pádraig Brady
Subject: Re: cp/mv: add -n option to not overwrite target (Ubuntu bug #229182)
Date: Mon, 22 Dec 2008 13:55:29 +0000
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Eric Blake wrote:
> According to Pádraig Brady on 12/22/2008 2:54 AM:
>>> +  -f, --force                  do not prompt before overwriting  (The -f 
>>> option\n\
>>> +                                 overrides any previous -i or -n 
>>> options.)\n\
>>> +  -i, --interactive            prompt before overwrite  (The -i option\n\
>>> +                                 overrides any previous -f or -n 
>>> options.)\n\
>>> +  -n, --no-replace             do not overwrite an existing file  (The 
>>> -n\n\
>>> +                                 option overrides any previous -f or -i\n\
>>> +                                 options.)\n\
>> This is actually now quite confusing/inaccurate. I think these 3 options
>> should be mutually exclusive. I.E. if more than 1 specified an
>> error should be printed.
> 
> POSIX requires support for simultaneous -f and -i, in either order, so we
> can't error out there.  But since -n is an addition, we can error out
> depending on -f or -i, if that makes more sense than overriding.
> 
> Again, since we are modeling after the fact that FreeBSD provides it, what
> is the behavior on that platform when you mix-n-match -fin?
> 

Well I wouldn't treat -n differently if one must be able to specify both -f and 
-i.
But does POSIX really specify that? I can't see it from a quick read.
All I can see are a mention of the -HLP options:

"Specifying more than one of the mutually-exclusive options -H, -L, and -P
shall not be considered an error. The last option specified shall determine
the behavior of the utility."

cheers,
Pádraig.




reply via email to

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