diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-10 01:18:04 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-10 01:18:04 -0400 |
commit | 6be1afd2596ce871eac13f2961b5dab8f2b1e87d (patch) | |
tree | e0e5846dd0dea9af4615875df7ef161ca745f99a | |
parent | 6f57477ce09149c8aa7c22e3da858fa5be4b7729 (diff) |
windows disk free space checking
-rw-r--r-- | Utility/DiskFree.hs | 10 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | git-annex.cabal | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/Utility/DiskFree.hs b/Utility/DiskFree.hs index aa1bfeedb..1f23ff512 100644 --- a/Utility/DiskFree.hs +++ b/Utility/DiskFree.hs @@ -31,8 +31,18 @@ getDiskFree path = withFilePath path $ \c_path -> do safeErrno (Errno v) = v == 0 #else +#ifdef mingw32_HOST_OS + +import System.Win32.File + +getDiskFree :: FilePath -> IO (Maybe Integer) +getDiskFree path = catchMaybeIO $ do + (sectors, bytes, nfree, _ntotal) <- getDiskFreeSpace (Just path) + return $ toInteger sectors * toInteger bytes * toInteger nfree +#else getDiskFree :: FilePath -> IO (Maybe Integer) getDiskFree _ = return Nothing #endif +#endif diff --git a/debian/changelog b/debian/changelog index a51f2b664..f931bdd94 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ git-annex (5.20131131) UNRELEASED; urgency=low * import: better handling of overwriting an existing file/directory/broken link when importing * Windows: assistant and webapp work! (very experimental) + * Windows: Support annex.diskreserve. * Fix bad behavior in Firefox, which was caused by an earlier fix to bad behavior in Chromium. diff --git a/git-annex.cabal b/git-annex.cabal index b4b3d209d..789ded518 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -100,7 +100,9 @@ Executable git-annex if flag(Production) GHC-Options: -O2 - if (! os(windows)) + if (os(windows)) + Build-Depends: Win32 + else Build-Depends: unix -- Need to list these because they're generated from .hsc files. Other-Modules: Utility.Touch Utility.Mounts |