Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gitpyr.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!gatech!gitpyr!roy From: roy@gitpyr.UUCP (Roy J. Mongiovi) Newsgroups: net.micro.pc Subject: Re: More on the EXEC function call Message-ID: <132@gitpyr.UUCP> Date: Fri, 15-Feb-85 10:21:43 EST Article-I.D.: gitpyr.132 Posted: Fri Feb 15 10:21:43 1985 Date-Received: Sun, 17-Feb-85 04:34:15 EST References: <243@shell.UUCP> Organization: Georgia Institute of Technology, Atlanta, GA Lines: 18 > Could someone please tell me how I can inform DOS apriori that I > wish all standard output (or input) to be redirected? Is IOCTL the > way to go? If so, how is it done? To redirect stdin, you close handle 0 (which is standard input), and then open the file you want to be stdin. That file is allocated the first free file handle (in this case 0 since we just freed it), and voila! stdin is redirected. Likewise for stdout and handle 1. Then you load and exec your program. To get stdin/stdout back to the console, you can dup handle 2 (stderr) unless you have changed it also (in which case you can open "con:"). -- Roy J. Mongiovi. Office of Computing Services. User Services. Georgia Institute of Technology. Atlanta GA 30332. (404) 894-6163 ...!{akgua, allegra, amd, hplabs, ihnp4, masscomp, ut-ngp}!gatech!gitpyr!roy Who me? I'm not even a REAL modo, I'm only a quasi-modo.