At 09:59 AM 2/27/04 -0700, Wiggins d Anconia wrote:
>It appears netstat just reads the values from /proc/net and prints them
>in a nice way, so presumably you could use standard opens on the /proc
>files and read specifically what you want rather than having netstat
>parse them for you.  Though this might actually be one of the places
>where shelling out makes sense.  CPAN didn't turn up much...
>
>http://search.cpan.org/~vsego/Linux-net-dev-1.00/dev.pm

Hey, don't forget the end users on windows.  At last count there were more
than ... well lets see, one, two, three ... 

OK, the real reason I had to chime in is that I posted a similar query a
couple months ago, asking if there was Net::Netstat on CPAN and, if not,
why not.  On the face of it, netstat would seem just the kind of thing
you'd find on CPAN, along with interfaces to other network-related features
(HTTP, DNS, mail, FTP, news, sockets, and so on).  Your answer, Wiggins,
may well get to the heart of it, which may be that the source of the data
filtered by netstat is heavily system dependent and not amenable to a
generalized solution, meaning that (again, guessing) any code would be a
long chain of special cases.

Like the original poster ([EMAIL PROTECTED]), I have an application
which uses netstat and it pains me greatly to have to shell out to get that
information.  Not to mention the burden of dealing with path information,
error-handling if for some reason the shell fails, etc etc, when you know
for a fact that the network status information is definitely available if
you just knew how to ask the system for it.  The netstat portion of my
application is one of its most fragile parts.  

Does anyone know of another list specific to network programming where the
question might be raised?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to