www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/16/15:21:06

Message-Id: <m0xLvQf-0003KlC@fwd03.btx.dtag.de>
Date: Thu, 16 Oct 97 21:17 MET DST
To: djgpp AT delorie DOT com
References: <3 DOT 0 DOT 16 DOT 19971016132047 DOT 34a756c4 AT hem1 DOT passagen DOT se>
Subject: Re: sprintf() string length?
MIME-Version: 1.0
From: Georg DOT Kolling AT t-online DOT de (Georg Kolling)

Peter Palotas schrieb:
> >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!
> -- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se --

NUL (yes, with one L) is neither a file nor a pointer, it's a DOS device driver
(like CON, PRN, AUX and $CLOCK) but it can be used like a file. Its only task
is to do nothing... sounds strange! I don't know if a similar thing exists in
other OSs.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019