10 ms·
I got too excited about child_process.fork before I read the description. I was imagining it would be like C where I can fork, setup the env and exec. That woul
by 8___D 15y ago
I got too excited about child_process.fork before I read the description. I was imagining it would be like C where I can fork, setup the env and exec. That would probably be tricky and very ugly to implement, though..
- whatwhatwhat 15y agoI don't think it would be too many lines of code, tbh http://nodejs.org/docs/v0.5.0/api/all.html#child_process.exec http://nodejs.org/docs/v0.5.0/api/all.html#child_process.exe...
- iter8n 15y agochild_process.exec is different from n*x system exec. Node is still doing the fork()ing and exec()ing behind the scenes. Exposing those calls in node would give you direct access to the child process before executing your commands.
- felixge 15y agoI have a binding for *nix fork() here: https://github.com/felixge/node-nix https://github.com/felixge/node-nix However, you need to know what you are doing, otherwise you'll have multiple processes draining the same file descriptors which will give you some nice surprises : )
- iter8n 15y agoWow, awesome. It shouldn't be hard to create a binding for execvp as well then. I found the pipe() binding, but I can't use those fd's with child_process.spawn if i want to open them as fd 3, 4, 5, etc in the child.