|standard input and output||Teemu Ikonen||5/2/12 4:10 AM|
We needed way to control phantomjs binary by stdin and stdout for using it as queued rendering engine and noticed that reading from /dev/stdin and /dev/stdout with require('fs').open('/dev/stdin').readLine() didn't work as expected and blocked until end of file mark. Also those device files are not available in all platforms. I added stdin, stdout and stderr file objects as standard members to filesystem object, so its possible to do this:
I would like to get this or something similar on the main release, any comments if it's right approach for stdout/stdin or how to improve this?
Thanks, Teemu I.
|Re: standard input and output||Milian Wolff||5/2/12 5:02 AM|
|Re: standard input and output||Teemu Ikonen||5/2/12 5:43 AM|
Good point, I'll move the stdin/err/out as objects in system module
|Re: standard input and output||Ariya Hidayat||5/2/12 4:34 PM|
See also http://code.google.com/p/phantomjs/issues/detail?id=333 (and
the linked pull request). It's already almost fully implemented, just
needs some clean-up.
Ariya Hidayat, http://ariya.ofilabs.com
|Re: standard input and output||Teemu Ikonen||5/3/12 9:07 PM|
Thanks for update, I'll wait for the release!
|Re: standard input and output||Ariya Hidayat||5/3/12 9:22 PM|
Note that you are also free to improve the proposed pull request (it's
not completely done yet).