Web lists-archives.com

Permissions not set for 'other' when copying from Windows




Hi,

I'm trying to understand why a copied file from 'C:\' into
/home/user/try doesn't have the permissions set for 'other' (see below).

The following will create a file named 'try.txt':

PS C:\> new-item try.txt -itemtype file


    Directory: C:\


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        12/17/2018  04:10 PM          0 try.txt


PS C:\>


Now copying the newly created file using the cp command on Cygwin:

user@hostname ~/try
$ cp /cygdrive/c/try.txt $PWD/


Now, the touch utility is used to create a file named 'touch.txt':

user@hostname ~/try
$ touch touch.txt

The ls command shows:

user@hostname ~/try
$ ls -l
total 0
-rw-r--r-- 1 user None 0 Dec 17 04:12 touch.txt
-rwxr-x--- 1 user None 0 Dec 17 04:12 try.txt


When the file is created with the touch utility, the permissions are
properly set for 'user', 'group', and 'other' but when the file is
copied from outsite of Cygwin only the 'user' and 'group' permissions
are set.
Obviously, 'other' is not used on Cygwin, everytime the file is SCPed on
a linux server the permissions need to be change for 'other' to match
the permissions on that server.
Why is that so and is there a better way around this?


-- 
John Doe

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple