[cs631apue] File permission Control use oflag and mode

Jan Schaumann jschauma at stevens.edu
Sat Sep 14 15:49:36 EDT 2013


hao wu <hwu9 at stevens.edu> wrote:
 
> if the file already exist, /bin/cp will keep its original permissions,

I'm glad you noticed this.  Comparing your tool to what the system
cp(1) does for the use cases we consider is a good idea!

As you think about the different scenarios, also consider the principle
of least surprise: what would the user expect?  Having cp(1) preserve
the permissions when the target file already exists falls in line here.

-Jan


More information about the cs631apue mailing list