io - How to call an external program and pass a string as a stdin to it in lua? -


i'm writing simple script in lua. here's got stuck: i'd call external program , pass string it, sees stdin. how it?

you can use io.popen mode "w", returns file handler can write data to.

--test lua interpreter local f = io.popen("lua","w")  f:write("print 'hello lua'")  f:close() 

note function system dependent , not available in platforms.


Comments

Popular posts from this blog

c++ - Do gcc's __float128 floating point numbers take the current rounding mode into account? -

java - the value of local variable is not used -