Closed gobwas closed 9 years ago
Is this what you are looking for?
commandGood.on('close', function (exitCode) {
if (code !== 0) {
console.log('ps process exited with code ' + code);
} else {
console.log('Process was successful');
}
});
Hi, @CGavrila, no )
Im looking to some event, when I can decide to commandGood.stdin.write(...)
.
@gobwas: there may not be a way of doing this, as far as I know. You will get an error though if the spawn is not successful, so you could use that in order to stop the stdin.write
.
no error,means it is running,and if you want to handle the process forked,
fooYouSpawned.stdout.on('data', function(data) {});
may be helpful.other events like exit
,error
.Just deal with the life cycle of porcess
But i think it is not a node issue.
@dayuoba data
event will be fired just if there is some data to out by spawned process =)
May be, yes, and this is not a node issue. But by the way, it could be useful thing.
Hello!
How can I be noticed about successful spawning with
child_process.spawn()
?Example:
Thanks!