Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b6b5fcbfd39a69b914f6af931856ef5af63393fc

>---------------------------------------------------------------

commit b6b5fcbfd39a69b914f6af931856ef5af63393fc
Author: Ian Lynagh <[email protected]>
Date:   Sat Dec 1 22:28:50 2012 +0000

    Add newFilePath to System.Posix.Internals
    
    Needed for #7342

>---------------------------------------------------------------

 System/Posix/Internals.hs |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs
index 5583c3b..1633a3e 100644
--- a/System/Posix/Internals.hs
+++ b/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



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to