Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to know how to open a telnet session using aspect?? 1

Status
Not open for further replies.

joet7878

Programmer
Aug 16, 2001
10
AU
Im trying to read from a text file that lists a number of hosts. I want to be able to connect to one host at a time , do a check for files and then move on to the next telnet host in my text file..Can anyone help out??
 
You will need to set up a loop that reads each host name in
from the file, then call a procedure that checks for your
files and logs out of the host. The code should look
something like:

if fopen 0 hostNames.txt READ TEXT ;open file for read only
while not feof 0 ;loop while not end of file
fgets 0 hostName ;get host name from file

dial TELNET hostName ;establish telnet session
while $dialing ;loop while establishing telnet session
endwhile

if $carrier ;if session established
waitfor "login: " forever
call checkForFiles ;call processing block
else
errormsg "Connection Not Establised To %s." hostName
endif
endwhile
else
errormsg "File Not Found"
endif

Hope this helps.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top