PtokaX forum

PtokaX => Bugs => Topic started by: bastya_elvtars on 30 August, 2006, 22:39:05

Title: io.popen() does not work
Post by: bastya_elvtars on 30 August, 2006, 22:39:05
io.popen() does not work, this code fails:
local f=io.popen("dir","r")
for line in f:lines() do SendToAll(line)
end


Error is:
attempt to index local 'f' (a nil value)

When calling from Lua CLI and replacing SendToAll with print it works fine:
Volume in drive I is DESIGN
Volume Serial Number is 7B4B-38BE

Directory of I:\!!!PXL51!!!\scripts

2006.08.22.  23:09    <DIR>          .
2006.08.22.  23:09    <DIR>          ..
2006.08.22.  22:15    <DIR>          freshstuff
2006.05.15.  01:55            32˙966 freshstuff.lua
2006.08.22.  23:04             3˙968 fsv5.lua
2006.08.23.  03:02    <DIR>          rangefucker
2006.08.30.  22:38            13˙706 rangefucker2.5.lua
               3 File(s)         50˙640 bytes
               4 Dir(s)   1˙228˙374˙016 bytes free
Title: Re: io.popen() does not work
Post by: PPK on 31 August, 2006, 16:37:22
Source of actual PXLua 5.1.1 (http://www.ptokax.org/files/PXLua-5.1.1.7z) is available for tweaking  ::)
Title: Re: io.popen() does not work
Post by: bastya_elvtars on 26 October, 2006, 13:12:41
Is there any additional info on this?
Posted on: 04 September 2006, 20:20:38
Is there any progress on this?
Title: Re: io.popen() does not work
Post by: PPK on 26 October, 2006, 15:19:37
No.
Title: Re: io.popen() does not work
Post by: PPK on 29 March, 2008, 15:15:07
Result of script on 0.4.0.0e1-service running as console app
Quote
[15:14:53]  Volume in drive C is CECKO
[15:14:53]  Volume Serial Number is 193A-17EF
[15:14:53]  Directory of c:\DC\PtokaX\devel-service\New\scripts
[15:14:53] 28.03.2008  16:54    <DIR>          .
[15:14:53] 28.03.2008  16:54    <DIR>          ..
[15:14:53] 28.03.2008  20:04               234 shutdown.lua
[15:14:53] 29.03.2008  15:10               134 popen.lua
[15:14:53]                2 File(s)            368 bytes
[15:14:53]                2 Dir(s)   9˙674˙063˙872 bytes free
[15:14:53] <_@o'> *** PePeK started script: popen.lua
Title: Re: io.popen() does not work
Post by: bastya_elvtars on 29 March, 2008, 16:00:20
Whoa! Great! Thank you!