Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #8320 > unrolled thread
| Started by | Victor Porton <porton@narod.ru> |
|---|---|
| First post | 2018-01-22 00:43 +0200 |
| Last post | 2018-01-22 00:43 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.programming
What if a subprocess disconnects stdin and/or stdout? Victor Porton <porton@narod.ru> - 2018-01-22 00:43 +0200
| From | Victor Porton <porton@narod.ru> |
|---|---|
| Date | 2018-01-22 00:43 +0200 |
| Subject | What if a subprocess disconnects stdin and/or stdout? |
| Message-ID | <p43532$1is6$1@gioia.aioe.org> |
I am writing "Command Communication Library": https://github.com/vporton/libcomcom The most immediate purpose is to (synchronously as of the planned first release): Run an OS command with the given string written to stdin and with stdout returned (as a string) to the caller after the command finished. It is clear what to do if the child process exits. But what if the child process does NOT exit but closes stdin and/or stdout? What should I do in this case? Should I kill the process? Should I wait when it finishes? Should I return the stdout now, even despite the process has not yet finished? P.S. This libcomcom is a VERY long time should be already have been written. I wonder if I am the first person who solves this problem. -- Victor Porton - http://portonvictor.org
Back to top | Article view | comp.programming
csiph-web