Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1280 closed bug (fixed)

System.Directory.getPermissions gives wrong answer on Vista

Reported by: simonmar Owned by: simonmar
Priority: high Milestone: 6.8.1
Component: Compiler Version: 6.6
Keywords: Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


access(X_OK,...) isn't supported by the C runtime on Vista (strictly speaking, it hasn't been supported on any Windows OS, but Vista checks the arguments a bit more carefully than earlier OSs). This means that System.Directory.getPermissions claims that everything is non-executable, and consequently Cabal fails when trying to invoke something via rawSystemPath (in Distribution.Simple.Utils).

This is making GHC's build fall over on Vista currently, so we need a fix/workaround (current workaround is to disable the getPermissions call in Distribution.Simple.Utils.rawSystemPath).

Change History (7)

comment:1 Changed 10 years ago by claus

the mingw folks seem to have a related fix for their 2007-03-26 mingw-runtime-3.12 release:

* include/io.h (__mingw_access): New static inline wrapper to restore 
pre-Vista 'access (fname, X_OK)' behaviour. 
(__USE_MINGW_ACCESS): Use to map access() to __mingw_access(). 

comment:2 Changed 10 years ago by simonmar

The mingw fix restores the old behaviour, namely that X_OK is ignored, which effectively means that all files appear to be executable. Also they did it by adding an inline function to unistd.h, which means we'd need a C wrapper to get their fix.

I think we should implement this properly (whatever that means) in 6.8.

comment:3 Changed 10 years ago by igloo

Owner: set to simonmar

Simon will be looking at the Vista problems

comment:4 Changed 10 years ago by simonmar

Fixed, hopefully:

Thu Aug 23 12:16:05 GMT Daylight Time 2007  Simon Marlow <>
  * FIX #1280: getPermissions wasn't working on Vista

I'm waiting for a Windows binary dist so I can test on Vista.

comment:5 Changed 10 years ago by simonmar

Resolution: fixed
Status: newclosed


comment:6 Changed 10 years ago by igloo

Milestone: 6.8 branch6.8.1

comment:7 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.