bug-fileutils
[Top][All Lists]
Advanced

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

Re: cp -p


From: Noel L Yap
Subject: Re: cp -p
Date: Fri, 3 Nov 2000 12:56:10 -0500



address@hidden on 2000.11.03 12:29:39
>> I feel that "cp -p" should not ignore the umask (although I see that
>> this is the behaviour of Solaris's cp, too) because:
>
>I disagree.  I believe the behavior is proper when specifying the -p
>option.  Check out the online UNIX98 docs:
>
>  http://www.unix-systems.org/single_unix_specification_v2/

I understand what the specs say, I just disagree with them.

>>    Even if the user chmod's the file(s) afterwards, there is still a
>>    window of possibly excessive permissions.
>>    Users who wish to have the current behaviour can set their umask
>>    before the cp, then reset it afterwards.
>
>But the reverse is also true with the current implementation.  User's
>that desire umask to be respected can avoid specifying the -p option.

Not exactly, specifying -p will preserve timestamps, too, but I see you realized
that below.

>But perhaps your request is really that you want a way to preserve
>only timestamps on the file and no other attributes and the present
>set of options does not provide a way to do that?  Something like
>--preserve-timestamps or some such?

Yes, in my rush to complain :-) I had forgotten to suggest such an extension in
options.  I was thinking something more like:

     cp --preserve=timestamp,owner,group,mode

where any of "timestamp", "owner", "group", or "mode" may or may not be
specified.  The default behaviour of "cp --preserve" would be the way it is now
(ie preserve everything that can be).

Since I didn't know how to make such a code change (ie have optional arguments
to long options) nor did I have time to learn, I settled for changing my own
private copy to do what I want (I love open source ;-)

Noel



This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its
subsidiaries and affiliates.




reply via email to

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