[luatex] Can't open pipe in .tex doc

Michael Talbot-Wilson mtw at view.net.au
Tue Aug 14 01:02:55 CEST 2012


On Tue, 14 Aug 2012, Reinhard Kotucha wrote:

> On 2012-08-14 at 07:39:28 +0930, Michael Talbot-Wilson wrote:
>
> > $ cat textst7.tex && luatex textst7
> > \directlua {a = io.popen("ls /")
> > if a == nil then
> >     print "Woe is me!"
> > else
> >     for c in a:lines(1) do print(c) end
> >     io.close(a)
> > end}
> > \bye
> > This is LuaTeX, Version beta-0.70.2-2012062812 (TeX Live 2012)
> >   restricted \write18 enabled.
> > (./textst7.texWoe is me!  <================================<<<<<
> >   )
> > No pages of output.

> I assume that you are wondering about
>
> > No pages of output.

No, I'm wondering why the popen fails.  It works, and the directory is
printed, when the \directlua chunk is a standalone lua script run by
lua or texlua.

> print() prints to screen (as in standalone Lua or texlua).  If you
> want to write to a PDF file, use tex.print() instead of print().

You missed the point.  Thanks, anyway, for taking the trouble to
reply.

> In order to get the documentation, run
>
>  texdoc luatex
>
> on the command line.

I have the 189-page LuaTeX Reference beside me.  I'm hoping that
img.node (p.77) will gel with box registers (p. 112) and I'll be able
to put an image read through a pipe into a TeX box.  But the manual
has no index, and I didn't notice "Security" as an entry in the TOC.
Where should I look in it for something relevant to the above problem?


More information about the luatex mailing list