How to use cp.exe from Cygwin and save permissions

I use cp.exe from Cygwin to copy files in Windows 7. Unfortunately, when I allow file changes.

I tried using:

cp --preserve=all 

But this also does not work, and when I check the security of the source file and the copy, the copy has different permissions.

Obviously, when copying using Cygwin there must be a way to save permissions, but I can not find it.

+6
source share
2 answers

I did some more research about this after I asked the question above.

Per is a discussion with one of the Cygwin developers, it seems that Cygwin does not care about Windows permissions and just sticks to POSIX.

From what I can tell, POSIX permissions are a separate thing from Windows, so yes, it’s great that they are supported, but ultimately Cygwin cannot copy files and support regular Windows permissions. To do this is useless to me. It is much better to use Python or Ruby.

I wish everything was wrong.

+7
source

I believe that adding the noacl option to the / cygdrive mount point in the / etc / fstab file will do what you want.

 $ cat fstab # For a description of the file format, see the Users Guide # http://cygwin.com/cygwin-ug-net/using.html#mount-table # This is default anyway: # none /cygdrive cygdrive binary,posix=0,user 0 0 none /cygdrive cygdrive binary,posix=0,user,noacl 0 0 

See http://cygwin.com/cygwin-ug-net/using.html#mount-table and a discussion from the cygwin mailing list.

+9
source

Source: https://habr.com/ru/post/903321/


All Articles