From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/81677 Path: news.gmane.org!not-for-mail From: Marco Patzer Newsgroups: gmane.comp.tex.context Subject: Read output of external command Date: Sun, 14 Apr 2013 12:06:13 +0200 Message-ID: <20130414100613.GW5709@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0311059710==" X-Trace: ger.gmane.org 1365934002 24349 80.91.229.3 (14 Apr 2013 10:06:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Apr 2013 10:06:42 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Apr 14 12:06:46 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from [195.12.62.10] (helo=balder.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1URJpd-0003PB-7c for gctc-ntg-context-518@m.gmane.org; Sun, 14 Apr 2013 12:06:45 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AC23F10273; Sun, 14 Apr 2013 12:06:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7ugAip56IaOZ; Sun, 14 Apr 2013 12:06:23 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 2989610260; Sun, 14 Apr 2013 12:06:23 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5643B10260 for ; Sun, 14 Apr 2013 12:06:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ap+XYuebWbem for ; Sun, 14 Apr 2013 12:06:20 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 6115F1021C for ; Sun, 14 Apr 2013 12:06:20 +0200 (CEST) Original-Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3EA6Iou025278 for ; Sun, 14 Apr 2013 12:06:19 +0200 Original-Received: from c.earth.lavabit.com (c.earth.lavabit.com [192.168.111.12]) by karen.lavabit.com (Postfix) with ESMTP id DAF8A11B906 for ; Sun, 14 Apr 2013 05:06:16 -0500 (CDT) Original-Received: from homerow (83.68.239.193) by lavabit.com with ESMTP id MSQN7R5LZE4G for ; Sun, 14 Apr 2013 05:06:16 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=waQNm//qWEj+Jld2wN1IrD0+PKOfbgVP1JI9IYZCZSy4ndqrCfx8lFDKWPV6F/gHPzGk95aox/NjYyMz1G0P4BMNqA83wVh++QnyZPOQGDNa7O82d2od1LusMD9Jc1GWjHa7MNUDXnn5fN5+2sKOPVsjvl9FlZgJ138tfZLmqUk=; h=Date:From:To:Subject:Message-ID:Mail-Followup-To:MIME-Version:Content-Type:Content-Disposition:User-Agent; Mail-Followup-To: mailing list for ConTeXt users User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.249.41.33; country=US; region=TX; city=Dallas; postalcode=75204; latitude=32.8019; longitude=-96.7883; metrocode=623; areacode=214; http://maps.google.com/maps?q=32.8019,-96.7883&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WJnK6ik2 - 453e109a3ca5 - 20130414 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:81677 Archived-At: --===============0311059710== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kAOhhqH5290wydqT" Content-Disposition: inline --kAOhhqH5290wydqT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --kAOhhqH5290wydqT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJRan+VAAoJEPGqVaNSn0iKzggIAJGUhyMv0noUvW2Chu+7F2Bb qkFtQNPpbB5LgQQg45cQ/7d68mE7dd3Uy7HN5TRKE+/fG2gLKMgfglhdkD8AvrxB QwNrWp1GaIbZW024IYvnJnI4rJeUXUPYD/c0fLmu+rwXi5/2UlPHsRMD1l01FuBu HutwKSYrhJDNz8c6VGMNZIPedP0pXns089nSE+ftTpRU5YeyX8IVi7mIWCN9wFmE rdSJp6gVdG92GiPHpyiQ7A7KGPrIxw9n++k0HvGtf/jEqNlqgQ+Y9GzzfdzXeGGt WQrMovdTpt1FBXTWrvkFv9fdNGB1JclGAE88y7l4Pmoy3u+FTVaE414bJH1NboM= =2VVN -----END PGP SIGNATURE----- --kAOhhqH5290wydqT-- --===============0311059710== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0311059710==--