Author Topic: io.popen() does not work  (Read 3835 times)

0 Members and 1 Guest are viewing this topic.

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 749
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
io.popen() does not work
« on: 30 August, 2006, 22:39:05 »
io.popen() does not work, this code fails:
Code: [Select]
local f=io.popen("dir","r")
for line in f:lines() do SendToAll(line)
end

Error is:
Code: [Select]
attempt to index local 'f' (a nil value)
When calling from Lua CLI and replacing SendToAll with print it works fine:
Code: [Select]
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
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

io.popen() does not work
« on: 30 August, 2006, 22:39:05 »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: io.popen() does not work
« Reply #1 on: 31 August, 2006, 16:37:22 »
Source of actual PXLua 5.1.1 is available for tweaking  ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 749
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: io.popen() does not work
« Reply #2 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?
Everything could have been anything else and it would have just as much meaning.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: io.popen() does not work
« Reply #3 on: 26 October, 2006, 15:19:37 »
No.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: io.popen() does not work
« Reply #4 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
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 749
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: io.popen() does not work
« Reply #5 on: 29 March, 2008, 16:00:20 »
Whoa! Great! Thank you!
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

Re: io.popen() does not work
« Reply #5 on: 29 March, 2008, 16:00:20 »