more OsPath conversion

Finally reached Annex code in this conversion.

Sponsored-by: Graham Spencer
This commit is contained in:
Joey Hess 2025-01-25 10:54:51 -04:00
parent 51a6cd1ee6
commit f9d42c37c0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 64 additions and 37 deletions

View file

@ -35,7 +35,7 @@ rotateLog logfile = go 0
where
go num
| num > maxLogs = return ()
| otherwise = whenM (doesFileExist currfile) $ do
| otherwise = whenM (doesFileExist (toOsPath currfile)) $ do
go (num + 1)
rename (toRawFilePath currfile) (toRawFilePath nextfile)
where
@ -50,7 +50,7 @@ rotatedLog logfile n = logfile ++ "." ++ show n
{- Lists most recent logs last. -}
listLogs :: FilePath -> IO [FilePath]
listLogs logfile = filterM doesFileExist $ reverse $
listLogs logfile = filterM (doesFileExist . toOsPath) $ reverse $
logfile : map (rotatedLog logfile) [1..maxLogs]
maxLogs :: Int