Modify readProcess[WithExitCode] to allow setting current directory
The readProcess[WithExitCode] function does not allow to modify the working directory parameter passed to createProcess.
The documentation states 'readProcess and readProcessWithExitCode are fairly simple wrappers around createProcess. Constructing variants of these functions is quite easy'. I would call that a boldfaced lie, as the implementation of readProcess[WithExitCode] and its web of required, hidden helper functions spans multiple screen pages of subtle and error prone code. Just look at the numerous bug reports for it. It would seem rather unfortunate to extract and copy paste all of this from System.Process just to provide a working directory to a newly created process.
Maybe the call should be changed to simply specify a default CreateProcess record so all things like cwd/env could be customized?