io.popen() does not work
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

io.popen() does not work

Started by bastya_elvtars, 30 August, 2006, 22:39:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bastya_elvtars

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
Everything could have been anything else and it would have just as much meaning.

PPK

"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

bastya_elvtars

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.

PPK

"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

PPK

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

bastya_elvtars

Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk