Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!csli!gandalf From: gandalf@csli.STANFORD.EDU (Juergen Wagner) Newsgroups: comp.unix.wizards Subject: Re: Writing to A NON-Existing File in \"C\" Message-ID: <3381@csli.STANFORD.EDU> Date: 8 Apr 88 00:17:50 GMT References: <12860@brl-adm.ARPA> Reply-To: gandalf@csli.stanford.edu (Juergen Wagner) Organization: Center for the Study of Language and Information, Stanford U. Lines: 34 Why all these lengthy solutions? As I tried to e-mail (host unreachable), you could just do # define do_output_p(file) (!access((file),02)) and assign the result to a variable, say static int do_output_flag; main(...) ... { char *file; ... ... do_output_flag = do_output_p(file); ... } Then, to access the file use # define Fopen if (do_output_flag) fopen # define Printf if (do_output_flag) printf # define Fclose if (do_output_flag) fclose Of course, another alternative would be just to open "/dev/null" instead of the file specified. Juergen "Gandalf" Wagner, gandalf@csli.stanford.edu Center for the Study of Language and Information (CSLI), Stanford CA -- Juergen "Gandalf" Wagner, gandalf@csli.stanford.edu Center for the Study of Language and Information (CSLI), Stanford CA