trotter@ENUXHA.EAS.ASU.EDU (Russell T. Trotter) (05/20/91)
Newsgroups: comp.unix.wizards Subject: controlling ftp process from a shell script or C program Expires: References: Sender: Reply-To: trotter@enuxha.eas.asu.edu.UUCP (Russell T. Trotter) Followup-To: Distribution: world Organization: Arizona State Univ, Tempe AZ Keywords: I am trying to find an intelligent way to transfer files from an ftp server to my account. When I say intelligent I mean that it must handle cases where the ftp connection times out, or some other error occurs. If there is a connection it should send the userid and password, and issue the commands to get the files. The problem I have when writing such a beast myself is that I know of no way to get the result of say "ftp nowhere.edu", whether it connected or timed out. I tried doing this in C, but regardless if I got connected or not, it would always remain in the ftp process (or alway with an ftp prompt). I did discover a way to pass commands via the popen call from a C program, but the problem is WHICH command I send. Does anyone know of a way to get result status from commands given from an ftp process (or any other process like this)? I would greatly appreciate any suggestions or comments. Thank you. trotter@enuxha.eas.asu.edu
fitz@mml0.meche.rpi.edu (Brian Fitzgerald) (05/20/91)
>I am trying to find an intelligent way to transfer files from >an ftp server to my account. When I say intelligent I mean that Try "expect". The man page contains an example of how to do this. Expect was written by a wizardly person in order to reduce such problems to non-wizardly shell programming tasks. :-) Get expect by anon ftp from durer.cme.nist.gov in /pub. You also need the tcl library, available from ucbvax.berkeley.edu in /pub. Brian