start converting from System.Directory to System.OsPath
This is the start of a long road, got the first few files to compile after this large change. Sponsored-by: mycroft
This commit is contained in:
parent
d46504e51e
commit
05bdce328d
8 changed files with 185 additions and 47 deletions
|
@ -46,7 +46,6 @@ moveFile src dest = tryIO (R.rename src dest) >>= onrename
|
|||
rethrow = throwM e
|
||||
|
||||
mv tmp () = do
|
||||
let tmp' = fromRawFilePath (fromOsPath tmp)
|
||||
-- copyFile is likely not as optimised as
|
||||
-- the mv command, so we'll use the command.
|
||||
--
|
||||
|
@ -59,18 +58,18 @@ moveFile src dest = tryIO (R.rename src dest) >>= onrename
|
|||
ok <- copyright =<< boolSystem "mv"
|
||||
[ Param "-f"
|
||||
, Param (fromRawFilePath src)
|
||||
, Param tmp'
|
||||
, Param (fromRawFilePath (fromOsPath tmp))
|
||||
]
|
||||
let e' = e
|
||||
#else
|
||||
r <- tryIO $ copyFile (fromRawFilePath src) tmp'
|
||||
r <- tryIO $ copyFile src tmp
|
||||
let (ok, e') = case r of
|
||||
Left err -> (False, err)
|
||||
Right _ -> (True, e)
|
||||
#endif
|
||||
unless ok $ do
|
||||
-- delete any partial
|
||||
_ <- tryIO $ removeFile tmp'
|
||||
_ <- tryIO $ removeFile tmp
|
||||
throwM e'
|
||||
|
||||
#ifndef mingw32_HOST_OS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue