Mail Archives: djgpp/1997/10/20/21:47:31
Peter Palotas <blizzar AT hem1 DOT passagen DOT se> wrote:
> At 09.53 1997-10-16 +0100, you wrote:
> >I once read a solution to this (can't remember where though!):
> >
> >The "fprintf" command will return the number of characters output,
> >and you should fopen DOS's "NULL" file to send the output to.
> >"NULL" is a "black hole" which will swallow and ignore anything you
> >send to it. Although "NULL" never appears in a directory, it
> >exists everywhere. (I think the UNIX equivalent is "/dev/nul",
> >but I've never used UNIX.)
> Does anyone know if this works, and how compatible it is?
> Writing to a NULL pointer doesn't sound too good to me!
This will work on any filesystem that offers a "bit-bucket." Writing to
"/dev/null" will work on all Unix and Unix-alike operating systems, including
DJGPP. Writing to "NUL" will work on all Microsloth OS's, with the possible
exception of NT.
You aren't writing to a NULL -pointer-; you're writing to a file (called "NUL"
under DOS, whence comes your confusion, perhaps?).
--
[- firewind -]
[- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -]
[- "You're just jealous because the voices talk to -me-." -]
[- Have a good day, and enjoy your C. -]
[- (on a crusade of grumpiness where grumpiness is due) -]
- Raw text -