loading and executing a new child process
Questions tagged [spawn]
1125 questions
6
votes
1 answer
How do I collect coverage from child processes when running `cover -test`, and not otherwise? (Devel::Cover)
(I think I've seen the answer to this, but I can't find it again. The closest I have come across is this question).
I am hacking on prt and am trying to get full coverage data for my changes. Some of my new tests call system($^X, 'prt', ...) to…

cxw
- 16,685
- 2
- 45
- 81
6
votes
2 answers
Get full command-line string from child_process.spawn
I'm spawning a process with child_process.spawn(). How can I view the exact command line that is executed (including all command-line parameters passed into the spawn function)?
Here's my example that isn't working:
var s =…

Ryan Griggs
- 2,457
- 2
- 35
- 58
6
votes
2 answers
Processing messages from a child process thorough stderr and stdout with Python
My python code spawns the child process, and it prints out messages both stdout and stderr.
I need to print them differently.
I have the following code to spawn child process and get the stdout result from it.
cmd = ["vsmake.exe", "-f"]
p =…

prosseek
- 182,215
- 215
- 566
- 871
6
votes
2 answers
How to successfully parse the output of FFMpeg in NodeJS
So I have seen a lot of topics on FFMPeg and it's a great tool I learnt about today, but I have spent the day perfecting the command and now am a little stuck with the NodeJS part.
In essence the command does the following: take input from a Mac OSX…

Dahknee
- 591
- 3
- 12
- 28
6
votes
1 answer
Spawned Ruby process on Windows dies when shell is terminated
I am trying to spawn a Ruby process on Windows using something like this:
p1 = spawn('ruby', 'loop.rb', [:out, :err] => ['process.log', "w"], :new_pgroup => true)
I also then detach from the process via:
p1.detach
This should as far I understand…

Hardy
- 18,659
- 3
- 49
- 65
6
votes
1 answer
Spawn new child process with own console window
I've got a parent application in node.js which needs to spawn multiple worker applications (also in node.js) applications according to need.
I've already got communication working between them - don't need to use any of the built-in node stuff.
Now…

user2110845
- 385
- 8
- 19
6
votes
1 answer
Node: Read spawn stderr/stdout after quick exit event?
I'm using Node's spawn to create a new process. Sometimes this process will exit very quickly with an error code and a message on stderr. It appears that stderr is getting lost in this quick turnaround. I've tried this:
reader.stderr.on('data',…

srlm
- 3,186
- 2
- 27
- 40
6
votes
3 answers
Let NodeJS application update itself using NPM
Hej There,
I'm trying to add some non-conventional functionality to my NodeJS application but I'm having some trouble.
What I'm trying to do is the following:
I want to update my server code from the client. (An auto-update functionality if you…

jansmolders86
- 5,449
- 8
- 37
- 51
6
votes
6 answers
How to Spawn Child Processes that Don't Die with Parent?
I have a C++ program that acts as a watchdog over others. If it detects that a process is no longer running, it restarts it via system. The problem is, if I kill the watchdog process, any processes it has started up also die.
void*…

zachd1_618
- 4,210
- 6
- 34
- 47
5
votes
2 answers
How to get the sub-process pid in the expect shell script, after spawn
Part of the script a.exp:
#!/usr/bin/expect
# .....
spawn ssh -qTfnN -D $port $user@$host
expect "*assword:*"
# .....
How can I get the pid of sub-process "ssh".
If I execute these in bash shell, not in a script file, the result is
expect1.1>…

Yanjiong Wang
- 229
- 3
- 10
5
votes
1 answer
node.js EPIPE exception on child_process.spawn
I'm using node.js v0.6.10 although I've got the same issue on 0.6.7. Basically I run a child process using spawn that starts another node.js process, and communicates over stdout and stdin Here are the two scripts:
parent (cli.js):
var spawn =…

Eric Allam
- 197
- 3
- 11
5
votes
1 answer
Invalid argument(s): Illegal argument in isolate message: (object is aReceivePort)
I am not sure if I am doing anything wrong in this code but I am clearly passing a SendPort when spawning a new isolate, however when I call:
Infrastructure.instance.initialize(); I get following exception:
Invalid argument(s): Illegal argument in…

AKornich
- 682
- 5
- 16
5
votes
2 answers
How to "replace" `os.execvpe` on Windows efficiently - if the "child" process is an interactive command line application?
I am dealing with a Python script which does, after some preparation work, launch ssh. My script is actually a small CLI tool. On Unix-like systems, at the end of its life, the Python script replaces itself with the ssh client, so the user can now…

s-m-e
- 3,433
- 2
- 34
- 71
5
votes
1 answer
Node child_process.spawn bad file descriptor on windows with ipc
I am trying to spawn a command in node with ipc option via child_process spawn.
What I call:
const {spawn} = require('child_process');
const cmd = spawn('npm', ['-v'], {
shell: true,
stdio: ['inherit', 'inherit', 'inherit',…

ondrakr
- 163
- 1
- 5
5
votes
1 answer
RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]:stdout maxBuffer length exceeded
I get this error
when running this block of code,
reasoner = new Reasoner({
type: 'local',
folder: 'csp_files'
});
console.log("solving Model");
reasoner.solve(Model, (err, stdout, stderr, isSatisfiable) => {
…

user2829319
- 239
- 4
- 16