-
-
Notifications
You must be signed in to change notification settings - Fork 30
Description
From the lobste.rs thread:
As for subprocess management: The simple cases are: start a process, synchronously or asynchronously, but sync might suffice, if you can start a process in a go-routine. Be able to catch it's output or redirect it. Be able to merge the output streams (and redirect the merged stream), be able to provide input. So far for the basics. Then it gets harder: start a process asynchronously and be able to read out the streams while it runs, and to provide input base on the outputs. Most subporcessing libraries only offer the possibility to set the data that should be sent to stdin before the process is started, but not after starting it. Additionally, if you could do simple call chains like ls -la | wc -l and then catch the last output, that would be very nice too.
reference: https://lobste.rs/s/vw12iy/when_if_is_just_function#c_eyoih5