[commit: packages/Win32] ghc-head: wrap GetFileAttributesEx with a high level function (263c97f)

git at git.haskell.org git at git.haskell.org
Tue Mar 18 10:16:03 UTC 2014


Repository : ssh://git@git.haskell.org/Win32

On branch  : ghc-head
Link       : http://git.haskell.org/packages/Win32.git/commitdiff/263c97f33d360ec9d54fc21996e5d2759f3af0c6

>---------------------------------------------------------------

commit 263c97f33d360ec9d54fc21996e5d2759f3af0c6
Author: Marios Titas <redneb at gmx.com>
Date:   Thu Jun 6 19:50:06 2013 -0400

    wrap GetFileAttributesEx with a high level function


>---------------------------------------------------------------

263c97f33d360ec9d54fc21996e5d2759f3af0c6
 System/Win32/File.hsc |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/System/Win32/File.hsc b/System/Win32/File.hsc
index b419875..d17c042 100644
--- a/System/Win32/File.hsc
+++ b/System/Win32/File.hsc
@@ -462,6 +462,12 @@ getFileAttributes name =
 foreign import WINDOWS_CCONV unsafe "windows.h GetFileAttributesW"
   c_GetFileAttributes :: LPCTSTR -> IO FileAttributeOrFlag
 
+getFileAttributesExStandard :: String -> IO WIN32_FILE_ATTRIBUTE_DATA
+getFileAttributesExStandard name =  alloca $ \res -> do
+  withTString name $ \ c_name ->
+    failIfFalseWithRetry_ "getFileAttributesExStandard" $
+      c_GetFileAttributesEx c_name getFileExInfoStandard res
+  peek res
 foreign import WINDOWS_CCONV unsafe "windows.h GetFileAttributesExW"
   c_GetFileAttributesEx :: LPCTSTR -> GET_FILEEX_INFO_LEVELS -> Ptr a -> IO BOOL
 



More information about the ghc-commits mailing list