Message-Id: <3.0.32.19971003105005.0068b970@mail.santandersupernet.com> Date: Mon, 06 Oct 1997 23:13:45 +0200 To: djgpp AT delorie DOT com From: Jose Luis Perandones Colino Subject: Correct redirection Mime-Version: 1.0 Content-Type: text/enriched; charset="us-ascii" Precedence: bulk I use: a=open(templa,O_CREAT|O_RDWR|O_TRUNC|O_TEXT,S_IWUSR); if (a<<0) { perror("Temp file"); return 1; } close(fileno(stdout)); dup2(a,fileno(stdout)); close(a); /* Execute a DOS program that i want get output */ close(fileno(stdout)); dup2(oldstd,fileno(stdout)); close(oldstd); But if i use the standar output i don't redirect the output of my program ( i can't use myprogram.exe > out.txt ) becasuse it lost. Ciao and thanks.
Jose Luis Perandones Colino mailto:joepc AT writeme DOT com EmuWorks - http://www.geocities.com/SiliconValley/Bay/9494