Writing to A NON-Existing File in C

karish karish at denali.UUCP
Fri Apr 15 03:03:53 AEST 1988


Is there a pressing reason to actually WRITE to the bit-bucket,
instead of not writing at all?  My answer:  No, unless the task
is to wrap a canned program into a new interface.

My solution, which has already been posted (by someone whose
mailer screwed up, killing the second partr of the message)
is to use a special function to do the output.  If a disk
file is available, write to it; otherwise, call a null function
that doesn't write at all.

This can be done either with the C preprocessor (wire in the
behavior at compile time) or with pointers to functions.


My employer is not so foolish as to agree with all of my opinions.

Chuck Karish		ARPA:	karish at denali.stanford.edu
			UUCP:	{decvax,hplabs!hpda}!mindcrf!karish
			paper:	1825 California St. #5
				Mountain View, CA  94041



More information about the Comp.unix.wizards mailing list