Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!denali!karish From: karish@denali.UUCP (karish) Newsgroups: comp.unix.wizards Subject: Re: Writing to A NON-Existing File in C Message-ID: <42@denali.UUCP> Date: 14 Apr 88 17:03:53 GMT References: <12895@brl-adm.ARPA> <1399@laidbak.UUCP> Reply-To: decvax!mindcrf!karish (Chuck Karish) Organization: Mindcraft, Inc. Lines: 20 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@denali.stanford.edu UUCP: {decvax,hplabs!hpda}!mindcrf!karish paper: 1825 California St. #5 Mountain View, CA 94041