From: bretedward [mailto:[EMAIL PROTECTED]

>I am building up a filename in a C program. I would like to
>include the host name (computer name) of the machine that the
>script runs on. The script will be run on many different (all
>same OS and
>version) machines, so the host name will change depending on
>which machine the script is executed on.
>
>There is a DOS command "hostname" that returns the host name
>to the screen.
>
>I have tried using it directly in my C program with no
>success. My program thinks that hostname is a variable and
>stops because it has not been declared. I have also tried
>using hostname as the argument for the system command ->
>system(hostname).
>This also does not work.
>
>I am able to use the DOS command, mkdir, directly in my
>program. I was hoping to be able to do the same with hostname.
>
>I would like to capture the host name in a string variable in
>my script.

What is your definition of a computer's hostname? It's TCP/IP address
converted into a hostname according to a DNS or hosts lookup? The
NETBIOS name? NetBEUI? AppleTalk? IPX/SPX? Netware? Something else
entirely? What if it has more than one name or address (on any of the
network protocols I've mentioned) or protocol available?

--
PJH
"The difference between genius and stupidity is that genius had its
limits."
    - Albert Einstein



Alderley plc, Arnolds Field Estate, The Downs, Wickwar, Gloucestershire, GL12 8JD, UK
Tel: +44(0)1454 294556 Fax: +44 (0)1454 299272

Website : www.alderley.com  Sales : [EMAIL PROTECTED] Service : [EMAIL PROTECTED]

This email and its contents are confidential and are solely for the use of the intended recipient. If you are not the original recipient you have received it in error and any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. Should you receive this email in error please immediately notify [EMAIL PROTECTED]

This email has been scanned for viruses, however you should always scan emails with your own systems prior to opening.






To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=662390815


Yahoo! Groups Links

Reply via email to