Provide a raw ByteString version of FilePath and environment APIs
authorSimon Marlow <marlowsd@gmail.com>
Fri, 11 Nov 2011 16:18:48 +0000 (16:18 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 22 Nov 2011 12:36:48 +0000 (12:36 +0000)
commit34c7bf896f19b182cf6fa104e057f1df9df1254a
treeabdb8264ae52c62263fc0fb4b395906a64acb104
parentc213ae2ec6d9c71266aebc8e5b2326a9625fba7a
Provide a raw ByteString version of FilePath and environment APIs

The new module System.Posix.ByteString provides exactly the same API
as System.Posix, except that:

  - There is a new type: RawFilePath = ByteString

  - All functions mentioning FilePath in the System.Posix API
    use RawFilePath in the System.Posix.ByteString API

  - RawFilePaths are not subject to Unicode locale encoding and
    decoding, unlike FilePaths.  They are the exact bytes passed to and
    returned from the underlying POSIX API.

  - Similarly for functions that deal in environment
    strings (System.Posix.Env): these use untranslated ByteStrings
    in System.Posix.Environment

  - There is a new function

     System.Posix.ByteString.getArgs :: [ByteString]

    returning the raw untranslated arguments as passed to exec() when
    the program was started.
32 files changed:
System/Posix.hs
System/Posix/ByteString.hs [new file with mode: 0644]
System/Posix/ByteString/FilePath.hsc [new file with mode: 0644]
System/Posix/Directory.hsc
System/Posix/Directory/ByteString.hsc [new file with mode: 0644]
System/Posix/Directory/Common.hsc [new file with mode: 0644]
System/Posix/DynamicLinker.hsc
System/Posix/DynamicLinker/ByteString.hsc [new file with mode: 0644]
System/Posix/DynamicLinker/Common.hsc [new file with mode: 0644]
System/Posix/DynamicLinker/Module.hsc
System/Posix/DynamicLinker/Module/ByteString.hsc [new file with mode: 0644]
System/Posix/DynamicLinker/Prim.hsc
System/Posix/Env/ByteString.hsc [new file with mode: 0644]
System/Posix/Files.hsc
System/Posix/Files/ByteString.hsc [new file with mode: 0644]
System/Posix/Files/Common.hsc [new file with mode: 0644]
System/Posix/IO.hsc
System/Posix/IO/ByteString.hsc [new file with mode: 0644]
System/Posix/IO/Common.hsc [new file with mode: 0644]
System/Posix/Process.hsc
System/Posix/Process/ByteString.hsc [new file with mode: 0644]
System/Posix/Process/Common.hsc [new file with mode: 0644]
System/Posix/Temp/ByteString.hsc [new file with mode: 0644]
System/Posix/Terminal.hsc
System/Posix/Terminal/ByteString.hsc [new file with mode: 0644]
System/Posix/Terminal/Common.hsc [new file with mode: 0644]
tests/all.T
tests/fileStatus.hs
tests/fileStatusByteString.hs [new file with mode: 0644]
tests/getEnvironment02.hs [new file with mode: 0644]
tests/getEnvironment02.stdout [new file with mode: 0644]
unix.cabal