haskell/win32 — pull request #10 by redneb (2013-06-07 00:09:21+00:00)
Title: Add support for GetFileAttributesEx

GetFileAttributesEx [1] has the peculiarity that it returns the information requested in a struct whose type depends on the value of the fInfoLevelId parameter. This causes a problem to haskell because we don't know what type to use. Because of that, I decided to split this pull request into two commits. The first one should be fairly uncontroversial: it introduces both datatypes required by GetFileAttributesEx and a c_* function that directly calls GetFileAttributesEx. In the second commit, I introduce a function called getFileAttributesExStandard which calls GetFileAttributesEx with the fInfoLevelId parameter set to GetFileExInfoStandard. This is currently the only allowed value for this parameter. Because of the fact that there is a unique value for the paramater, I think this is a good compromise. I am open to any other suggestions.

Note that the absence of this function from Win32 blocks a bug with the directory package [2], which is a core package.

[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa364946%28v=vs.85%29.aspx
[2] http://hackage.haskell.org/trac/ghc/ticket/7473