Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!killer!elwiz From: elwiz@killer.UUCP (Chert Pellett) Newsgroups: comp.unix.wizards Subject: Re: Writing to A NON-Existing File in "C" Message-ID: <3922@killer.UUCP> Date: 25 Apr 88 05:00:24 GMT References: <9654@jplgodo.UUCP> <14020030@hpisod2.HP.COM> <887@cresswell.quintus.UUCP> <50280@sun.uucp> Reply-To: elwiz@killer.UUCP (Chert Pellett) Organization: The Unix(R) Connection BBS, Dallas, Tx Lines: 19 How about just try: int fd; fd = open (FILENAME, O_APPEND| O_RDWR); /* Will fail if file not there */ if (fd < 0) fd = open ("/dev/null", O_RDWR); /* Discard output, as per original article */ if you want to use stdio, use the fdopen (fd, "w+") to get your FILE * type... -- Chert Pellett (why would anyone use stat/access then have to do an open call?)