Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!ENUXHA.EAS.ASU.EDU!trotter From: trotter@ENUXHA.EAS.ASU.EDU (Russell T. Trotter) Newsgroups: comp.unix.wizards Subject: controlling ftp process from a shell script or c program Message-ID: <9105200353.AA09540@enuxha.eas.asu.edu> Date: 20 May 91 03:53:08 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: trotter@enuxha.eas.asu.edu (Russell T. Trotter) Organization: Arizona State Univ, Tempe AZ Lines: 28 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