diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-12-01 22:28:50 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-12-01 22:28:50 +0000 |
commit | 954ef66adca5f63e71261c6ea0aa0d7879430f02 (patch) | |
tree | b3d9112bfddf5ea278d832e6f11df1efa599943c /libraries/base/System/Posix/Internals.hs | |
parent | cfa1da94143563ff42269eed0ac3665b5040b07c (diff) | |
download | haskell-954ef66adca5f63e71261c6ea0aa0d7879430f02.tar.gz |
Add newFilePath to System.Posix.Internals
Needed for #7342
Diffstat (limited to 'libraries/base/System/Posix/Internals.hs')
-rw-r--r-- | libraries/base/System/Posix/Internals.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs index 5583c3b5ed..1633a3e508 100644 --- a/libraries/base/System/Posix/Internals.hs +++ b/libraries/base/System/Posix/Internals.hs @@ -191,20 +191,26 @@ fdGetMode fd = do withFilePath :: FilePath -> (CWString -> IO a) -> IO a withFilePath = withCWString +newFilePath :: FilePath -> IO CWString +newFilePath = newCWString + peekFilePath :: CWString -> IO FilePath peekFilePath = peekCWString #else withFilePath :: FilePath -> (CString -> IO a) -> IO a +newFilePath :: FilePath -> IO CString peekFilePath :: CString -> IO FilePath peekFilePathLen :: CStringLen -> IO FilePath #if __GLASGOW_HASKELL__ withFilePath fp f = getFileSystemEncoding >>= \enc -> GHC.withCString enc fp f +newFilePath fp = getFileSystemEncoding >>= \enc -> GHC.newCString enc fp peekFilePath fp = getFileSystemEncoding >>= \enc -> GHC.peekCString enc fp peekFilePathLen fp = getFileSystemEncoding >>= \enc -> GHC.peekCStringLen enc fp #else withFilePath = withCString +newFilePath = newCString peekFilePath = peekCString peekFilePathLen = peekCStringLen #endif |