Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hao.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!hao!woods From: woods@hao.UUCP (Greg Woods) Newsgroups: net.unix,net.unix-wizards,net.lang.f77 Subject: Re: pipe breaking Message-ID: <1832@hao.UUCP> Date: Wed, 30-Oct-85 15:24:34 EST Article-I.D.: hao.1832 Posted: Wed Oct 30 15:24:34 1985 Date-Received: Sat, 2-Nov-85 04:53:18 EST References: <629@lasspvax.UUCP> Organization: High Altitude Obs./NCAR, Boulder CO Lines: 26 Xref: watmath net.unix:6104 net.unix-wizards:15542 net.lang.f77:406 > This fortran program accepts the uncompacted data from standard input > via an unformatted read statement and plots it; it exits from the > plotting loop when an EOF condition is detected. At this point I > want the program to accept input from the keyboard; however, it > continues to read from the pipe. Do you have any advice on how I > can redirect the input once the EOF is reached? Thanks for your support. This one is not too hard. You can catch the EOF, close unit 5, and then reopen it to read from the terminal. The code looks like: read(5,end=100) ... c jumps to statement label 100 when EOF sensed .... 100 close(unit=5) c close pipe open(unit=5,file='/dev/tty') c reopen unit 5 to terminal read(5,... c read from terminal --Greg -- {ucbvax!hplabs | allegra!nbires | decvax!noao | mcvax!seismo | ihnp4!noao} !hao!woods CSNET: woods@NCAR ARPA: woods%ncar@CSNET-RELAY