tech-userlevel archive

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

Re: cp -n diff



Am 03.05.11 21:56, schrieb Marc Balmer:
> Am 03.05.11 21:37, schrieb Zafer Aydoğan:
>> 2011/5/3 Joerg Sonnenberger <joerg%britannica.bec.de@localhost>:
>>> On Tue, May 03, 2011 at 08:30:35PM +0200, Zafer Aydoğan wrote:
>>>> Hello list,
>>>>
>>>> attached is a patch that implements the -n option for cp, which skips 
>>>> existing
>>>> files on the target.
>>>
>>> Please, no. Just use the right tool for the job.
>>>
>>> Joerg
>>>
>>
>> by "right tools" I suppose you refer to pax.
>> Clearly, there could be tons of other tools to accomplish this task,
>> but thats not my point. I would like to enrich cp of a feature that
>> it is clearly missing in NetBSD.
>> Although -n isn't POSIX, it is common behaviour.
>> What arguments are there besides pax ?
> 
> please stop adding silly options to every program.  please stop
> enriching cp.  this feature IS NOT MISSING IN NETBSD.
> 
> Ah, Linux added it, FreeBSD followed it, so we need it, too, I see...
> 
> cp is for copying files.  if I do not want to copy files, I do not enter
> cp, I certainly do not enter cp -n.
> 
> or, if e.g., I do not want to shutdown my system, should I enter
> "shutdown -n" ?
> 
> or, if e.g., I do not want to see the contents of a directory, should I
> enter "ls -n" ?
> 
> or, if e.g., I want system pos-01 to overseleep a bit, would I enter
> "wake -n pos-01" ?

oh, and let's not forget to add the '-s' option to cp:  copy *some*
files.  It would use a secure random number generator to choose which
files to copy, so that an attack based on predictability of which files
are actually copied is not possible.

Combined with '-n' it could mean:  copy some files, if no one objects.
This command would send out an email to the NetBSD developers community
at large to ask if someone objects copying a file.

Maybe '-c', copy only if color matches, would make sense as well: Copy
the file only, if the color of the bikeshed matches.  cp myfile -c blue
/target/dir would only be copied if /target/dir was actually painted in
blue, but not if /target/dir was painted in orange.

I am sure as a creative developers community we can think of many other
useful, non-POSIX additions to cp.



Home | Main Index | Thread Index | Old Index