Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site burl.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxl!mhuxm!pyuxi!pyuxnn!pyuxmm!cbdkc1!cbosgd!ihnp4!clyde!burl!rcj From: rcj@burl.UUCP Newsgroups: net.unix-wizards Subject: freopen of actual stdin question Message-ID: <359@burl.UUCP> Date: Wed, 26-Oct-83 00:59:36 EDT Article-I.D.: burl.359 Posted: Wed Oct 26 00:59:36 1983 Date-Received: Thu, 27-Oct-83 05:43:30 EDT Organization: Western Electric, Burlington, NC Lines: 28 I have a question on freopen -- I want to run a program (an assembler that I am writing -- called 'emma') on N files, where one of those 'files' might be stdin. A sample command line might be: m4 light_bulb | emma -dp foo bar paddy - indicating that the user wants to assemble files 'foo', 'bar', and 'paddy'; then take input from stdin (the output of the 'm4' on 'light_bulb'). What I want to know is -- if I use freopen to associate each filename in turn with stdin, like this: freopen(filename, "r", stdin); then how do I, upon encountering the '-' at the end of the command line, re-associate the stream stdin with the output of the 'm4' that is being piped into emma? Please reply via mail -- to cut down on traffic I will tell you now that I am posting this in the early am of Oct. 26. If you are replying to me after Oct. 30, you are probably too late as I will have an answer by Monday if it kills me. :-) Thanks very much for your time, -- The MAD Programmer -- 919-228-3814 (Cornet 291) alias: Curtis Jackson ...![ floyd clyde ihnp4 mhuxv ]!burl!rcj