cygwin

cygwin sets file permission to 000


I have a folder /cygwin/d/myfolder/ And everytime I save files there, from cygwin if i do an ls -la I see that the files are given permission 000. That actually causes me quite a bit of problem as I rsync this folder to my server and none of the files are accessible. How can I get the files to automatically get a reasonable permission?


Solution

  • Have a read through the answers at this link: http://cygwin.1069669.n5.nabble.com/vim-and-file-permissions-on-Windows-7-td61390.html

    The solution there worked for me also:

    Edit /etc/fstab and add this line at the end of the file:

    none /cygdrive cygdrive binary,noacl,posix=0,user 0 0
    

    Then close all Cygwin processes, open a new terminal and ls -l on your files again.

    Explanation: By default, Cygwin uses the filesystem's access control lists (ACLs) to implement real POSIX permissions. Some Windows-native program or process may create or modify the ACLs such that Cygwin computes the POSIX permissions as 000. With the noacl mount option, Cygwin ignores filesystem ACLs and only fakes a subset of permission bits based on the DOS readonly attribute.