File permissions
On Windows 9x systems, files are always readable, and Cygwin uses the
native read-only mode to determine if they are writable. Files are
considered to be executable if the filename ends with .bat, .com or .exe, or
if its content starts with #!. Consequently chmod can
only affect the "w" mode, it silently ignores actions involving the other
modes. This means that ls -l
needs to open and read files. It can thus be relatively slow.
Under NT, file permissions default to the same behavior as Windows
9x but there is optional functionality in Cygwin that can make file
systems behave more like on UNIX systems. This is turned on by adding
the "ntea" option to the CYGWIN environment variable.
When the "ntea" feature is activated, Cygwin will start with basic
permissions as determined above, but can store POSIX file permissions in NT
Extended Attributes. This feature works quite well on NTFS partitions
because the attributes can be stored sensibly inside the normal NTFS
filesystem structure. However, on a FAT partition, NT stores extended
attributes in a flat file at the root of the partition called EA
DATA. SF. This file can grow to extremely large sizes if you
have a large number of files on the partition in question, slowing the
system to a crawl. In addition, the EA DATA. SF file
can only be deleted outside of Windows because of its "in use" status. For
these reasons, the use of NT Extended Attributes is off by default in
Cygwin. Finally, note that specifying "ntea" in CYGWIN has no
effect under Windows 9x.
Under NT, the test "[ -w filename]" is only true if filename is
writable across the board, e.g. chmod +w filename.