It is currently February 23rd, 2024, 9:34 am

io.popen is nil on Windows 10?

Discuss the use of Lua in Script measures.
Posts: 3
Joined: November 16th, 2022, 4:07 pm

io.popen is nil on Windows 10?

Post by jorm »

Nevermind; I found
I'm leaving the question for reference.

I'm trying to use io.popen to ping a host.
The line is:

Code: Select all

local p = io.popen('ping -n 1 -w 1 ' .. addr_lan)
with addr_lan being an ip address, of course.
The error messag in the log is:

Code: Select all

Script: Ping2Hosts.lua:21: attempt to call field 'popen' (a nil value)
As far as I read, io.popen should be defined under Windows 10. Could that be a missing library or binding?

(I used os.execute before, but that flashed a command window every time, which was annoying.)

Any other way to get a ping result, without flashing windows?
Thanks in advance.
User avatar
Rainmeter Sage
Posts: 2565
Joined: March 23rd, 2015, 5:26 pm

Re: io.popen is nil on Windows 10?

Post by SilverAzide »

This is documented in the Rainmeter manual:
Gadgets Wiki GitHub More Gadgets...