[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [RCR] Kernel#hostname

Berger, Daniel

11/25/2003 3:52:00 PM

> -----Original Message-----
> From: Ara.T.Howard [mailto:ahoward@ngdc.noaa.gov]
> Sent: Tuesday, November 25, 2003 2:07 AM
> To: ruby-talk@ruby-lang.org
> Subject: [RCR] Kernel#hostname
>
>
>
>
> this one is short, so i'm inlining it here:
>
> having to include 'socket' only to do 'Socket.gethostname'
> definitely is not in line with POLS - IMHO
>
> i understand _why_ (not the lucky one) #gethostname should be
> part of the Socket module, but i think
>
> host = hostname # Kernel.hostname
>
> would be a nice addition to ruby.

On some platforms (Solaris) you have to link against -lsocket anyway on
the C side of the house, so whether or not you explicitly have to
'require "socket"', you probably are requiring it behind the scenes.

Where do you draw the line? What about gethostbyaddr? Or gethostbynam?

I actually started by own package "sys/host" before I realized that you
do everything it does through the socket module, although I had hoped to
be a little better with regards to multi-nic machines and IPV6. I've
sorta let it fall by the wayside.

I definitely do *not* think it belongs as part of Kernel.

Regards,

Dan