Skip to main content

Questions tagged [child-process]

For code that manages processes (child processes) spawned by other processes (parent processes).

8 votes
4 answers
1k views

Run command in a child process

Inspired by this answer from SO, I try to find a version of fork()/exec()/wait() which: starts a child process; catches stdout, stderr and return code separately; properly handles all possible errors ...
D.J. Elkind's user avatar
5 votes
2 answers
627 views

RAII POSIX process created by fork

By analogy with std::thread, I've written an RAII POSIX process: ...
jezza's user avatar
  • 205
1 vote
1 answer
46 views

Bulk recompiling edits to files by running external processes with a pool of 4 workers using asyncio

I am bulk recompiling edits to a c-like language which uses an external compiler.exe. The compiler takes the file paths as arguments and does the processing, nothing needs to be synchronized simply ...
0xKate's user avatar
  • 521
5 votes
1 answer
3k views

Executing a Bash script from C++

I am trying to execute a Bash command, get the pid, read the (error) output and optionally pass input. I am still quite new at C++ and I would like to know if this is a correct & safe ...
user3876583945's user avatar
1 vote
1 answer
59 views

Executing a multi-parameter external command to dump ArrangoDB from Python

I am aware there are several ways to deal with shell-executions in Python but I haven't really found the right one for me as it includes the following structure: ...
Qohelet's user avatar
  • 151
2 votes
2 answers
187 views

nice utility in C

I implemented the nice linux command. How can I improve the program? In terms of optimization, error handling, bugs and possible undefined behaviors ...
Mark's user avatar
  • 449
0 votes
1 answer
112 views

Spawning a child process that is accessible in global scope through use of eval()

So basically my question is what would be a better way to achieve my goal? The code below works fine but looks like it is extremely inefficient and could be achieved in a better way. The code ...
WoJo's user avatar
  • 103
3 votes
1 answer
79 views

display processes children

The following program uses a parent program to determine the PIDs of multiple child processes. A function is called to return them to a dynamic vector (with the children's pids, but also the elements ...
Mike's user avatar
  • 299
1 vote
1 answer
904 views

data sent through a pipe from parent to child

I wrote a program that uses a pipe to send messages from a parent to a child. Question: Is this the correct way I sent the messages? Could I have done otherwise? ...
Mark's user avatar
  • 449
7 votes
2 answers
117 views

Network utility tool

I wrote a little program in C based on some requirements: Ping every IP from a file and check the result Show, by network adapter, ONLY the IP, subnet, default gateway and DNS Check the speed between ...
Norhther's user avatar
  • 269
2 votes
0 answers
824 views

Reading stdout and stderr of a sub process using Win32, Overlapped I/O

I'm writing C++ Windows code that will start a process, then read its stdout and stderr, separately, into buffers. If I try to just read the streams one at a time it may hang if the child process is ...
user11693's user avatar
1 vote
0 answers
1k views

Execute command using `asyncio.create_subprocess_shell` and yield lines of stdout, stderr and finally the return code

My task is to run a subprocess using asyncio.create_subprocess_shell and yield the lines of output. I am using asyncio to avoid ...
user7610's user avatar
  • 569
4 votes
1 answer
216 views

Spawn a Linux subprocess without leaking FDs

I'm working on a library of shell utilities for Swift, and at the core of it is the need to spawn a subprocess. For Linux, I came up with the following function to do the low-level work. ...
cobbal's user avatar
  • 141
3 votes
1 answer
69 views

Run an external program and extract a pattern match along with the result file

The script takes two input files of protein sequences and runs an external program (installed in linux/MacOS). The result provides a text output file example output.. Identity percentage is extracted ...
catuf's user avatar
  • 433
1 vote
0 answers
222 views

Spawning multiple child processes to preview Vue.js projects

Context: I'm making a Codepen-like app but I want it to support sophisticated JS libraries/frameworks like Vue or Angular 2+ for example. I want to have a live preview of my snippet which updates in a ...
Sebastian Kaczmarek's user avatar

15 30 50 per page
1
2 3 4 5
7