hard links on windows

* annex.thin and annex.hardlink are now supported on Windows.
* unannex --fast now makes hard links on Windows.
This commit is contained in:
Joey Hess 2016-04-08 15:25:32 -04:00
parent 251405eca2
commit cf06dac2b8
Failed to extract signature
8 changed files with 29 additions and 26 deletions

View file

@ -1,6 +1,6 @@
{- POSIX files (and compatablity wrappers).
-
- This is like System.PosixCompat.Files, except with a fixed rename.
- This is like System.PosixCompat.Files, but with a few fixes.
-
- Copyright 2014 Joey Hess <id@joeyh.name>
-
@ -21,6 +21,7 @@ import System.PosixCompat.Files as X hiding (rename)
import System.Posix.Files (rename)
#else
import qualified System.Win32.File as Win32
import qualified System.Win32.HardLink as Win32
#endif
{- System.PosixCompat.Files.rename on Windows calls renameFile,
@ -32,3 +33,10 @@ import qualified System.Win32.File as Win32
rename :: FilePath -> FilePath -> IO ()
rename src dest = Win32.moveFileEx src dest Win32.mOVEFILE_REPLACE_EXISTING
#endif
{- System.PosixCompat.Files.createLink throws an error, but windows
- does support hard links. -}
#ifdef mingw32_HOST_OS
createLink :: FilePath -> FilePath -> IO ()
createLink = Win32.createHardLink
#endif