-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
Milestone
Description
See also issue #4290. StdinPipe (for instance) returns a WriteCloser but then closes it in Wait. That's bad design: a package that returns a Closer shouldn't then close it for you silently. But the real problem is that this property makes it impossible to use StdinPipe correctly to deliver data to the process, since any program attempting to write to the pipe to deliver input to the process must close the file descriptor itself to signal EOF. There is a deadly embrace: The process won't exit until EOF; the EOF won't be delivered until the process exits. I believe StdinPipe should be deprecated, and a new method (call it XXX) that returns a WriteCloser, but that Wait does not close that file descriptor. It would be the well-documented responsibility of the client to close XXX explicitly. I haven't thought through StdoutPipe but perhaps it has a related issue.