
On Thu Dec 11 2014 at 7:10:51 PM Donn Cave
On Thu, Dec 11, 2014 at 10:18 AM, Michael Snoyman
wrote: You can use readProcess[1], but it has some downsides:
1. Can't specify all options to CreateProcess, e.g., working directory and environment variables.
2. Relies on lazy I/O
I sure feel a pall of dread at the words "lazy I/O", but in this case, readProcess takes the curse off it by evaluating the output, am I right? Hence the repeated assurances in the documentation that it's strict.
I honestly don't know if the "curse" has been lifted in this case. It could be that readProcess is perfectly safe and (unlike hGetContents) doesn't have dangerous corner cases. I'm not certain. One other issue that I forgot to mention though is that you're required by the readProcess API to deal with the output from the process as textual data, which is often times not appropriate. And given how complicated the internals of readProcess are, it's highly unlikely someone would get that right on their first attempt to port the code to use ByteString. Michael