process: Confusion about UseHandle handles being closed.

Henning Thielemann lemming at henning-thielemann.de
Sat Nov 29 19:22:10 UTC 2014



On Sat, 29 Nov 2014, Bertram Felgenhauer wrote:

> Henning Thielemann wrote:
>>
>> On Tue, 25 Nov 2014, Michael Snoyman wrote:
>>
>>> 1. Add clear documentation to `createProcess` indicating that it will close the `Handle` automatically.
>>> 2. Add a new function to be exported from `System.Process` with the semantics of `createProcess_`. I'm open
>>> to bikeshedding on the name, but perhaps sticking with `createProcess_` makes the most sense.
>>
>> I think the cleanest solution would be to add a new field (e.g. leaveOpen)
>> to the CreateProcess record.
>
> Wouldn't it be more natural to add a new constructor to the StdStream
> type?

Yes, this would allow to choose a closing procedure per stream. 
(Nonetheless, a smart setter function 'leaveOpen' could turn all StdStream 
fields to ShareHandle.)


More information about the Libraries mailing list