« first day (4033 days earlier)      last day (36 days later) » 

7:15 AM
@ToxicFrog And if you are not doing something relatively simple?
 
 
6 hours later…
1:17 PM
@FaheemMitha then you use fork-exec.
There is not a strong incentive to make something more powerful than popen() because fork-exec lets you run arbitrary process setup code, so there's no equivalent to e.g. the CreateProcess* family on windows.
 
 
4 hours later…
5:16 PM
Does anyone have recommendations about reading or writing to a pipe, but the whole thing at once. Preferably without all that pesky fiddling around with buffer as much as possible. Doesn't need to be portable. POSIX is fine.
Searching is finding a bunch of different things. Not sure which way to go. Recommendations appreciated.
 
 
1 hour later…
6:45 PM
@FaheemMitha if the file you're trying to execute doesn't exist, then it can't be executed, and execlp() returns an error. But if it is successfully executed, then what happens next depends on what the code of the executed program does. It might fail, or it might succeed. But at that point, execlp() can't return any more, because the program image was replaced. The program calling execlp() doesn't exist any more at that point. Because it's been replaced with the program you executed.
@FaheemMitha here, the execlp() succeeds and the sh that starts goes on doing what it is it does.
 
@ilkkachu Yes, I figured out that something like that must be the case.
@ilkkachu In this case, returning an error. :-)
@ilkkachu You seem quite familiar with this Unix C programming. Is this something you use regularly?
It seems somewhat exotic to me, but I suppose it's widely used at the system level.
 
no, I don't use that stuff often, just one of the things I've learned.
 
7:03 PM
Once I've constructed the pipe between parent and child, and done a dup2 with stdout and stderr on the child, I can just use stdout or stderr on the child, and it will go to the constructed pipe, correct? I tried this and it seems to work.
 

« first day (4033 days earlier)      last day (36 days later) »