I'm using cp.exe from Cygwin to copy files in Windows 7. Unfortunately, when I do the permissions of the file change.
I've tried using:
cp --preserve=all
But that doesn't work either, and when I check the security of the original file vs the copy, the copy has different permissions.
Clearly there must be a way to preserve permissions when copying using Cygwin, but I can't find it.
I believe adding option noacl to the /cygdrive mount point in /etc/fstab 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 discussion from the cygwin mailing list.
I did some more investigation about this after asking the question above.
Per this discussion with one of Cygwin's developers, it appears that Cygwin doesn't care about Windows permissions, and just sticks with the POSIX ones.
From what I can tell, POSIX permissions are a whole separate thing from the Windows ones, so yes, it's great that they're supported, but ultimately, Cygwin can't copy files and maintain normal Windows permissions. Making it useless to me. Much better to use Python or Ruby.
I would love to be proven wrong though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With