Re: file mode handling

Eli Zaretskii <eliz-mXXj517/[email protected]>
Newsgroups gmane.comp.gnu.mingw.user
Message-ID <[email protected]>
> From: Wim Vervoorn <[email protected]>
> Date: Thu, 27 Jun 2019 09:39:17 +0000
> 
> I am running both mingw and Cygwin on my Windows 8 system.
> 
> My problem is that if I have a file that reports file mode 755 on Cygwin it reports 644 on MinGW. This is
> causing problems in some cases.
> 
> Is there a way to configure MinGW to report the same file mode as Cygwin? 

You will have to do that in your own application code, or write
replacements for library functions (like 'stat' and 'fstat'), because
MinGW uses functions from the Microsoft Windows runtime (MSVCRT.DLL),
which can only report Read and Write mode bits.  And even these two
bits aren't synchronized with NTFS Security descriptors of the files,
so you could have a file that appears to be writable, but if you try
to actually write, you will get an error.

> I assume this has to do with the method used by Cygwin to map the execute permission as this is not part of
> NTFS by default.

Cygwin uses NTFS Security features to access those bits, whereas the
MSVCRT emulation of Posix 'stat' doesn't.  It has nothing to do with
NTFS, it's just that the Posix emulation on Windows is very
rudimentary.

_______________________________________________
MinGW-Users mailing list
[email protected]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.osdn.me/mailman/listinfo/mingw-users
Also: mailto:[email protected]?subject=unsubscribe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.