(net-service) on Windows?

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
kanen
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

(net-service) on Windows?

Post by kanen »

Is it possible to use (net-service) on Windows?

I've tried a few different ways to do this and none of them seem to work properly.

Anyone?
. Kanen Flowers http://kanen.me .

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: (net-service) on Windows?

Post by Lutz »

Works for me on Windows XP SP2:

Code: Select all

newLISP v.10.6.0 32-bit on Win32 IPv4/6 libffi, options: newlisp -h

> (net-service "http" "tcp")
80
> (net-service "ftp" "tcp")
21
> (net-service 21 "tcp")
"ftp"
> (net-service 80 "tcp")
"http"
>
on Unix it would depend on the textfile /etc/services, perhaps on Windows there is something similar somewhere, perhaps in the registry database? For services not registered it would return nil.

Locked