Xref: utzoo comp.unix.questions:31890 comp.unix.wizards:25839 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!uflorida!winnie!zach!ecs58365 From: ecs58365@zach.fit.edu ( BOWMASTER JR) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: dbm docs? Message-ID: <2586@winnie.fit.edu> Date: 2 Jun 91 15:27:23 GMT References: <1991May18.203633.21387@dartvax.dartmouth.edu> <12177:May2521:45:5991@kramden.acf.nyu.edu> <19336@rpp386.cactus.org> Sender: usenet@winnie.fit.edu Reply-To: ecs58365@zach.UUCP ( BOWMASTER JR) Followup-To: comp.unix.questions Organization: Florida Institute of Technology, ACS, Melbourne, FL Lines: 19 I am writing a utility FTPDIR, which will recursively search ftp directories for a pattern name, since most ftp's don't support an ls -R or a grep. To do this, I am running an ftp as a child under my main program, and communicating with the child via pipes. I have redirected stdin and stdout to my pipe, and set them as unbufferd using the setbuf command. This works for the child, but as soon as I exec (or system, or popen) ftp, the stdout gets set back to block buffered. I have tried using popen on ftp and then using setbuf(stdout,NULL), but it still will not work. (I know that the pipe is working, and that it's a buffering problem, since I do get a responsafter I've sent 'verbose' to the child ftp about 2000 times). I also tried to do a setlinebuf(stdout), but my version of C gives a link error (unix C on a Harris HCX-9). If anyone knows how I can set the stdout to line buffered or unbuffered and have it stay that way when I call ftp, I would be much happy if they could please clue me in. Thanx, James Bowmaster Florida Institute of Technology ecs58365@zach.fit.edu