How to preserve file mode attributes with cygwin cp command on Windows 10?

The same cygwin version 1.5.25 is installed on Windows 7 and Windows 10.

With a perl script using the stat command, I see the source file mode is 666.

The source file is a simple text file.

After doing a cp to copy the file into another folder, the mode of the target file stays at 666 on Windows 7 but becomes 444 on Windows 10.

Using either -p or --preserve=mode doesn't seem to change the outcome of the cp operation on Windows 10.

Is there a way to preserve the mode attributes such that the target file doesn't become read-only on Windows 10?

The version of cp retrieved with cp --version is 6.10 and it is at C:\cygwin\bin\cp.exe.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like