ryah ([info]four) wrote,
@ 2009-06-19 18:29:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:programming

Why isn't there a bidirectional popen()?
Good read: http://lua-users.org/lists/lua-l/2007-10/msg00189.html


In node I think it will look like this

var cat = popen("cat");

cat.onOutput = function (chunk) {
  puts("cat said: '" + chunk + "'");
};

cat.onExit = function (code) {
  puts("the cat program exited with code " + code);
};

cat.write("hello world");
cat.close();
cat.kill(); 



(2 comments) - (Post a new comment)


[info]tomtomtomtomtom
2009-06-19 07:00 pm UTC (link)
var cat

poopin cat

cat write
cat close
cat kill

(Reply to this)


[info]nibot
2009-06-21 02:52 am UTC (link)
Thanks for posting the link - I was just wanting a bidirectional popen yesterday and thinking to myself, "I seem to remember this is fraught with difficulties..."

(Reply to this)


(2 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…