avoid unix-compat's rename

On Windows, that does not support long paths
https://github.com/jacobstanley/unix-compat/issues/56

Instead, use System.Directory.renamePath, which does support long paths.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-07-12 14:53:32 -04:00
parent bad39cadc6
commit 2d65c4ff1d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
18 changed files with 75 additions and 20 deletions

View file

@ -18,6 +18,7 @@ module Utility.LogFile (
) where
import Common
import Utility.RawFilePath
#ifndef mingw32_HOST_OS
import System.Posix.Types
@ -36,7 +37,7 @@ rotateLog logfile = go 0
| num > maxLogs = return ()
| otherwise = whenM (doesFileExist currfile) $ do
go (num + 1)
rename currfile nextfile
rename (toRawFilePath currfile) (toRawFilePath nextfile)
where
currfile = filename num
nextfile = filename (num + 1)