var spawn = require('child_process').spawn;
var child = spawn('/path/to/my/script');
var stdout = '';
var stderr = '';
child.stdout.on('data', function (data) {
stdout += data;
});
child.stderr.on('data', function (data) {
stderr += data;
});
child.on('exit', function (code) {
console.log('child process exited with code ' + code);
var runner = new Runner({stdout: stdout, stderr: stderr});
runner.save().then(function() {
res.redirect('/');
});
});
I found that some time not all stdout/stderr will be saved.
Only part of stdout/stderr is saved.
What is wrong?
via Sato
No comments:
Post a Comment