FIX #1280: getPermissions wasn't working on Vista
authorSimon Marlow <simonmar@microsoft.com>
Thu, 23 Aug 2007 11:16:05 +0000 (11:16 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 23 Aug 2007 11:16:05 +0000 (11:16 +0000)
commitb33cc8f0d60e7ab53a916bff339ff40a677e0a62
treeee875dbc34e19d0443525b6ca01357aa5fa6c5e0
parent933bc96e88506ef6f8953ee71b3b3c8d53e7eed5
FIX #1280: getPermissions wasn't working on Vista
It turns out that _access() in the Windows C runtime used to ignore
the X_OK flag, in Vista it now returns an error.  After browsing the C
runtime sources, I discovered that _stat() has an almost but not quite
completely bogus implementation of the st_mode field, which lets us
implement a slightly less incorrect approximation to getPermissions than does
_access().
System/Directory.hs
include/HsDirectory.h