![](https://secure.gravatar.com/avatar/d39338246f50cca667c8256c313d7cfd.jpg?s=120&d=mm&r=g)
14 Apr
2013
14 Apr
'13
12:06 p.m.
Hi, I need to read the standard output of an external command. This is what I came up with: \starttext \startluacode f = io.popen "ls" context(f:read "*a") \stopluacode \stoptext It works with luajittex, plain lua5.1 and lua5.2, but it fails with a current luatex: ! LuaTeX error [string "\directlua "]:3: attempt to index global 'f' (a nil value) stack traceback: [string "\directlua "]:3: in main chunk. Why does this fail in luatex but works in lua5.2 ? What is the correct way to obtain the output of a command? Marco