[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36
John Goerzen
jgoerzen at complete.org
Fri Apr 23 14:59:23 UTC 2010
The following commit has been merged in the master branch:
commit cfb5a73e4241532bbf774d91128e442e75507ef8
Author: John Goerzen <jgoerzen at complete.org>
Date: Thu Jul 21 21:00:13 2005 +0100
HVFS now builds on Windows
diff --git a/MissingH/IO/HVFS.hs b/MissingH/IO/HVFS.hs
index c5e4323..fd2dd40 100644
--- a/MissingH/IO/HVFS.hs
+++ b/MissingH/IO/HVFS.hs
@@ -121,6 +121,14 @@ reasonable values.
A default implementation of this is not currently present on Windows.
-}
+
+#ifdef mingw32_HOST_OS
+-- these types aren't defined here
+type LinkCount = Int
+type UserID = Int
+type GroupID = Int
+#endif
+
class (Show a) => HVFSStat a where
vDeviceID :: a -> DeviceID
vFileID :: a -> FileID
@@ -128,14 +136,9 @@ class (Show a) => HVFSStat a where
{- | Refers to file permissions, NOT the st_mode field from stat(2) -}
vFileMode :: a -> FileMode
-#ifndef mingw32_TARGET_OS
- -- | Not supported on Windows
vLinkCount :: a -> LinkCount
- -- | Not supported on Windows
vFileOwner :: a -> UserID
- -- | Not supported on Windows
vFileGroup :: a -> GroupID
-#endif
vSpecialDeviceID :: a -> DeviceID
vFileSize :: a -> FileOffset
@@ -302,12 +305,28 @@ instance HVFS SystemFS where
vRenameDirectory _ = renameDirectory
vRemoveFile _ = removeFile
vRenameFile _ = renameFile
+#ifndef mingw32_HOST_OS
vGetFileStatus _ fp = getFileStatus fp >>= return . HVFSStatEncap
+#else
+ vGetFileStatus _ _ = fail "Getting file status not supported on Windows"
+#endif
+#ifndef mingw32_HOST_OS
vGetSymbolicLinkStatus _ fp = getSymbolicLinkStatus fp >>= return . HVFSStatEncap
+#else
+ -- No symlinks on Windows; just get the file status directly
+ vGetSymbolicLinkStatus = vGetFileStatus
+#endif
+
vGetModificationTime _ = getModificationTime
+#ifndef mingw32_HOST_OS
vCreateSymbolicLink _ = createSymbolicLink
vReadSymbolicLink _ = readSymbolicLink
vCreateLink _ = createLink
+#else
+ vCreateSymbolicLink _ _ _ = fail "Symbolic link creation not supported by Windows"
+ vReadSymbolicLink _ _ = fail "Symbolic link reading not supported by Widnows"
+ vCreateLink _ _ _ = fail "Hard link creation not supported by Windows"
+#endif
instance HVFSOpenable SystemFS where
vOpen _ fp iomode = openFile fp iomode >>= return . HVFSOpenEncap
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list