[Mingw-users] file mode handling

Back to archive index
Wim Vervoorn wverv****@eltan*****
Thu Jun 27 23:59:24 JST 2019


Hello Eli,

This is clear thanks.

Best Regards,
Wim Vervoorn



-----Original Message-----
From: MinGW-Users [mailto:mingw****@lists*****] On Behalf Of Eli Zaretskii
Sent: Thursday, June 27, 2019 3:21 PM
To: MinGW Users List <mingw****@lists*****>
Subject: Re: [Mingw-users] file mode handling

> From: Wim Vervoorn <wverv****@eltan*****>
> 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
MinGW****@lists*****

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:mingw****@lists*****?subject=unsubscribe


More information about the MinGW-Users mailing list
Back to archive index