HostName(0)
BlitzMax Forums/BlitzMax Programming/HostName(0)| 
 | ||
| Print HostName(0) returns nothing on my Mac (10.4). Works fine on Windows. Any ideas? | 
| 
 | ||
| Ditto here Mac (10.5.8) fine on Windows? | 
| 
 | ||
| Probably because 0.0.0.0 is not a valid address on Mac ? | 
| 
 | ||
| Does this work? Print HostName( HostIp("localhost") ) | 
| 
 | ||
| That just prints localhost ;o) | 
| 
 | ||
| Does this work? Print hostname(hostip("127.0.0.1")) | 
| 
 | ||
|  That just prints localhost ;o)  Strage - it doesn't on Windows... It prints the computer name (which I assume is what you are after). Hmmmm... | 
| 
 | ||
|   Strage [sic] - it doesn't on Windows  Perhaps because Windows doesn't name localhost by default? I dunno. | 
| 
 | ||
|  Perhaps because Windows doesn't name localhost by default? I dunno.  It does name localhost, but it's done through an alias in the hostfile for 127.0.0.1... I guess it simply re-directs 'localhost' to the local machine at a DNS level, but it doesn't inherently considers its name to be localhost. | 
| 
 | ||
| What about this? SuperStrict Framework BRL.StandardIO Extern Function gethostname:Int(buf:Byte Ptr, length:Int) End Extern Local buf:Byte[100] If Not gethostname(buf, buf.length) Then Print String.FromCString(buf) End If | 
| 
 | ||
| Well that snippet does not work on windows but on my Mac it returns MacMini.local ? If Not ? | 
| 
 | ||
|   Well that snippet does not work on windows  Well, no. It wasn't intended to :-p | 
| 
 | ||
| :-P |