Mail Archives: djgpp/1996/04/19/09:01:58
From: kagel AT quasar
Date: Thu, 18 Apr 1996 18:24:35 -0400
HELP! I'd hoped that V2 would solve this because V2 solved a similar problem I
had with piped output, but, it did not. I am trying to write to the default
DOS printer (PRN, LPT1) and cannot. The app's output goes to the DJGPP temp
directory and never prints. Anyone have a solution? Anyone try this? I'll
post a code sample tomorrow.
In my Borland and other 16bit versions I just wrote to stdprn or opened a file
named "PRN" and voila! Neither solution seems to work. So ... HELP!
*********************
OK here is one version of the code (I've tried several):
#ifdef __DOS__
output = stdprn;
outstatus = TOPIPE;
#elif defined(unix)
output = (FILE*)NULL;
outstatus = TOPIPE;
#endif
...............
fprintf( output, line ); etc......
Another:
#ifdef __DOS__
output = NULL;
outname = "LPT1";
outstatus = TOFILE;
ALSO TRIED: outname = "PRN"; outname = "LPT1:"; outname = "PRN:";
#elif defined(unix)
output = (FILE*)NULL;
outstatus = TOPIPE;
#endif
..............
if (outstatus == TOFILE && output = (FILE *)NULL)
output = fopen( outname, "w" );
..............
fprintf( output, line ); etc......
--
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com
A proverb is no proverb to you 'till life has illustrated it. -- John Keats
- Raw text -