lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Yeah, that was a silly example... replace it with

       local f = io.popen('aprogramthatwritestostdout') 


On Mon, Feb 13, 2012 at 6:16 PM, Luiz Henrique de Figueiredo <> wrote:
> With vanilla Lua I can do
>       local f = io.popen('cat /proc/cpuinfo') -- runs command
>       local l = f:read("*a") -- read output of command

Why io.popen+cat when you can read the file directly with