Date: Mon, 4 Sep 1995 00:44:43 -0400 (EDT) From: Cuthalion / Sliced Bread To: DJGPP Listserver Subject: Re: Redirecting compileroutput to file On 2 Sep 1995, Frederic J. Walter-Scheerer wrote: > In fact it's only a silly DOS-question, but I think a lot of users of > djgpp should have the same problem: > > How can I redirect the warnings and errormessages (should be stderr) from > djgpp to a file ? > > If it depends on the DOS-version: I'm using MS-DOS 5.0 . > You could always try... THIS: (It works for me. It's not extra-super-convenient, but it does work.) #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. */ } /*************************************************************** *** Jesse Morris *** enrico AT max DOT tiac DOT net *** jmorris AT ace DOT com *** ***************** Cuthalion / Sliced Bread *******************/