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.


Thanks,

Bret





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=366923534


Yahoo! Groups Links

Reply via email to