On Saturday, 22 January 2022 at 20:55:38 UTC, Daren Scot Wilson
wrote:
I'm writing a command line program to control certain hardware
devices. I can hardcode or have in a config file the IP
addresses for the devices, if I know that info. If I don't?
Depending on the hardware, you might be able
On Sunday, 23 January 2022 at 06:30:11 UTC, frame wrote:
On Saturday, 22 January 2022 at 20:55:38 UTC, Daren Scot Wilson
wrote:
I don't see any D std.* libraries that do this. Are there a
Dub packages I should look at?
If you really want to this in D without any external app or OS
API you c
On Saturday, 22 January 2022 at 20:55:38 UTC, Daren Scot Wilson
wrote:
I don't see any D std.* libraries that do this. Are there a Dub
packages I should look at?
If you really want to this in D without any external app or OS
API you could just ping all possible hosts, see which respond and
On Saturday, 22 January 2022 at 22:44:31 UTC, forkit wrote:
and here is how to get the ip (depending on the formatting of
your output of course)
// ---
module test;
import std;
void main()
{
auto result = execute(["bash", "-c", "nmap -sn
192.168.11.0/24 | ack -B2 \"Philips\""]);
On Saturday, 22 January 2022 at 23:15:18 UTC, forkit wrote:
oh.. this is better i think...
ip = str[ ((lastIndexOf(str, "(")) + 1) .. lastIndexOf(str, ")")
];
On Saturday, 22 January 2022 at 20:55:38 UTC, Daren Scot Wilson
wrote:
is this helpful:
// ---
module test;
import std;
void main()
{
auto result = execute(["bash", "-c", "nmap -sn
192.168.11.0/24 | ack -B2 \"Phillips\""]);
if(canFind(result.to!string, "Host is up"))
writ
I'm writing a command line program to control certain hardware
devices. I can hardcode or have in a config file the IP addresses
for the devices, if I know that info. If I don't? Then I run an
'nmap' command and look for the devices. But why should I, a
human, have to do any work like that? B