View Single Post
Old 11-10-2009, 12:17 PM   #110
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Quote:
Originally Posted by hansel View Post
It's called io.popen()
Code:
  local f = io.popen("ls -l")        -- runs command
  local buf = f:read("*a")          -- read output of command
  f:close()
  print(buf)
Thanx. I find io.popen() now. I looked for them in the wrong section.

added:
another question:
how do I get the size of buf?

added 2:
I am trying using the length operator #.

Last edited by ericshliao; 11-10-2009 at 12:38 PM.
ericshliao is offline   Reply With Quote