Path: utzoo!utgpu!watserv1!ria!rrivax.rri.uwo.ca!lrb From: lrb@rrivax.rri.uwo.ca (Lance R. Bailey) Newsgroups: comp.unix.wizards Subject: Re: How to make ftp interact with sh-commands? Message-ID: <694@ria.ccs.uwo.ca> Date: 25 Jul 90 07:04:45 GMT References: <23946@adm.BRL.MIL> Sender: news@ria.ccs.uwo.ca Reply-To: lrb@rrivax.rri.uwo.ca Organization: Robarts Research Institute -- London Canada Earth Lines: 30 News-Software: VAX/VMS VNEWS 1.3-4 In article <23946@adm.BRL.MIL>, xphyhofu%DDATHD21.BITNET@cunyvm.cuny.edu ( Joachim Holzfuss) writes... >Hi, is there any wizard out there being able >to shed some light on this? > >I have to ftp files automatically from a directory,that grows >permanently. >Wat I did was: >ftp> mget file.* > ... >Seems like ftp doesn't like me. Any good ideas? what you need to do is ls file.* inlist and then use that to build a list of ftp commands, or a ftp script. so you have one session to get, you end it, build a script by prefixing all file names with get, the whole file with open and user commands AND SUFFIXING THE FILE WITH A CLOSE AND BYE. if you do not do that, many ftp implementations do not recognize EOF as close and when you feed ftp with the script for input, ftp goes into a tight/expensive forever-loop when the input stops. i implemented this using ftp as the tranport layer for uucico a while ago and ran into the same problem. only i had a program that talked to a popen to ftp, got the list, processed it and fed the answers to ftp again. one session. _________________________________ Lance R. Bailey, Systems Manager | Robarts Research Institute email: lrb@rri.uwo.ca | Clinical Trials Resources Group vox: 519-663-3787 ext. 4108 | P.O. Box 5015, 100 Perth Dr. fax: 519-663-3789 | London, Canada N6A 5K8