more OsPath conversion
Sponsored-by: Nicholas Golder-Manning
This commit is contained in:
parent
0376bc5ee0
commit
27305042f3
24 changed files with 180 additions and 153 deletions
|
@ -16,6 +16,7 @@ module Utility.FileIO
|
|||
(
|
||||
withFile,
|
||||
openFile,
|
||||
withBinaryFile,
|
||||
openBinaryFile,
|
||||
readFile,
|
||||
readFile',
|
||||
|
@ -52,6 +53,11 @@ openFile f m = do
|
|||
f' <- toOsPath <$> convertToWindowsNativeNamespace (fromOsPath f)
|
||||
O.openFile f' m
|
||||
|
||||
withBinaryFile :: OsPath -> IOMode -> (Handle -> IO r) -> IO r
|
||||
withBinaryFile f m a = do
|
||||
f' <- toOsPath <$> convertToWindowsNativeNamespace (fromOsPath f)
|
||||
O.withBinaryFile f' m a
|
||||
|
||||
openBinaryFile :: OsPath -> IOMode -> IO Handle
|
||||
openBinaryFile f m = do
|
||||
f' <- toOsPath <$> convertToWindowsNativeNamespace (fromOsPath f)
|
||||
|
@ -110,6 +116,9 @@ withFile = System.IO.withFile . fromRawFilePath
|
|||
openFile :: OsPath -> IOMode -> IO Handle
|
||||
openFile = System.IO.openFile . fromRawFilePath
|
||||
|
||||
withBinaryFile :: OsPath -> IOMode -> (Handle -> IO r) -> IO r
|
||||
withBinaryFile = System.IO.withBinaryFile . fromRawFilePath
|
||||
|
||||
openBinaryFile :: OsPath -> IOMode -> IO Handle
|
||||
openBinaryFile = System.IO.openBinaryFile . fromRawFilePath
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue