Date: Tue, 25 Jul 1995 22:31:24 -0400 (EDT) From: Cuthalion / Sliced Bread To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Redirecting standard error and stuff. Look, I've heard lots of people whining about how to get stderr redirected. Typically people have said "Set go32=2r1", but without go32, this doesn't work so great. So, give this a shot. It's not particularly elegant or happy or anything, but it (I hope) works. :) #include #include #include #define LOTS 1 #define MORE 2 void main(int argc, char **argv) { if (argc < 3){ printf("Usage: ThisFile.Exe \n"); exit(LOTS); } if ((freopen(argv[1],"wb",stderr) == NULL)) { printf("Stupid filename.\n"); exit(MORE); } execvp(P_WAIT, argv[2], &argv[3]); /* spawnvp(P_WAIT, argv[2], &argv[3]); */ /* Spawn fragments memory quite nicely. Try it sometime. */ } (I know this is very stable; I managed to succesfully redirect the error messages from one compile.. all 947 error messages. (You'll hear from me on this list again.. )) /*************************************************************** *** Jesse Morris *** enrico AT max DOT tiac DOT net *** jmorris AT ace DOT com *** ***************** Cuthalion / Sliced Bread *******************/