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

@ -16,6 +16,7 @@ module Utility.FileIO
(
withFile,
openFile,
openBinaryFile,
readFile,
readFile',
writeFile,
@ -51,6 +52,11 @@ openFile f m = do
f' <- toOsPath <$> convertToWindowsNativeNamespace (fromOsPath f)
O.openFile f' m
openBinaryFile :: OsPath -> IOMode -> IO Handle
openBinaryFile f m = do
f' <- toOsPath <$> convertToWindowsNativeNamespace (fromOsPath f)
O.openBinaryFile f' m
readFile :: OsPath -> IO L.ByteString
readFile f = do
f' <- toOsPath <$> convertToWindowsNativeNamespace (fromOsPath f)
@ -104,6 +110,9 @@ withFile = System.IO.withFile . fromRawFilePath
openFile :: OsPath -> IOMode -> IO Handle
openFile = System.IO.openFile . fromRawFilePath
openBinaryFile :: OsPath -> IOMode -> IO Handle
openBinaryFile = System.IO.openBinaryFile . fromRawFilePath
readFile :: OsPath -> IO L.ByteString
readFile = L.readFile . fromRawFilePath