This is a tiny set of portable bindings to popen
, pclose
, and fileno
.
This project exists because I was trying to bind to C functions that read/write
streams and require a raw file descriptors and nothing I found on Hackage or in
base
allowed me to work with raw file descriptors portably across Posix and
Windows.
The base
libraries do provide portable Handle
’s which work well if all
stream processing is done within Haskell. However it turned out to be quite
difficult to portably get and set a raw file descriptor from a Handle
.
System.Posix
does provide this functionality but it does not work on Windows.
Simply doing stack install
should work.
To help you get started this project ships with an executable ls-example
which simply lists the files in the current directory.