It looks like `ls(1)` for Win32 calls the `GetFileInformationByHandle`
function[1] when it checks file modes.  Therefore, it operates by file
attributes (`FILE_ATTRIBUTE_READONLY`, `FILE_ATTRIBUTE_DIRECTORY`,
etc.), which don't affect users in the file's group (g) or other users
not in the file's group (o).  The similar stuff is applied to
`chmod(1)`.

The security descriptors in Microsoft Windows have ``primary group''
information, which, I believe, exists there for compatibility with
POSIX, but GNU's coreutils don't use it.  May be because that ``primary
group'' exists only on NTFS.

> $ ls -l csv.icn
> -rw-r--r--

On Win32 ``rw-'' stands for ``file without read-only attribute''.  It
looks like `r--` for ``g'' and ``o'' is a default for `ls(1)` on Win32
(but I'm not sure, because I didn't find that in source code).

> $ chmod 775 csv.icn​

The only thing you can make with `chmod(1)` on Win32 is set ``Readonly''
attribute with `chmod u-w csv.icn`.  Operations with ``g'' and ``o'' are
effectively ignored.

May be I'm wrong somewhere; in this case I hope someone will correct me.

[1]
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle

On 3/20/2019 7:26 PM, Richard H. McCullough wrote:
> "ls" typically lists the same incorrect permissions for all files.
> "chmod" does not change permissions.
> 
> Are these commands going to be updated?
> 
> examples:
> 
> rhmcc@rhmZ570 MSYS /c/msys64/home/ke/KE/parser​
> $ ls -l csv.icn​
> -rw-r--r-- 1 rhmcc rhmcc 2079 Dec 30 14:55 csv.icn​
> ​
> rhmcc@rhmZ570 MSYS /c/msys64/home/ke/KE/parser​
> $ chmod 775 csv.icn​
> ​
> rhmcc@rhmZ570 MSYS /c/msys64/home/ke/KE/parser​
> $ ls -l csv.icn​
> -rw-r--r-- 1 rhmcc rhmcc 2079 Dec 30 14:55 csv.icn​
> ​
> rhmcc@rhmZ570 MSYS /c/msys64/home/ke/KE/parser​
> 
> Richard H. McCullough
> http://ContextKnowledgeSystems.org
> What is your context?
> 
> 
> 
> _______________________________________________
> Msys2-users mailing list
> Msys2-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/msys2-users
> 


_______________________________________________
Msys2-users mailing list
Msys2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to