Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!oliveb!pyramid!prls!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: comp.unix.questions Subject: Re: Stdio flaws? Message-ID: <798@mcgill-vision.UUCP> Date: Sun, 7-Jun-87 04:31:55 EDT Article-I.D.: mcgill-v.798 Posted: Sun Jun 7 04:31:55 1987 Date-Received: Sat, 13-Jun-87 11:26:29 EDT References: <345@phoenix.PRINCETON.EDU> <19977@sun.uucp> Organization: McGill University, Montreal Lines: 30 In article <19977@sun.uucp>, guy%gorodish@Sun.COM (Guy Harris) writes: >> For some unknown reason, fflush(3) only flushes output buffers, not >> input buffers. (The reason is "that's how it's written." :-) > Purging an input buffer is a completely separate operation; I agree > that it might be a good thing if standard I/O permitted you to do > this, but it is emphatically NOT the operation that "fflush" should > do. That's why fdumpbuf() is one of the things I've added to stdio. Only occasionally useful, but when you want it there's basically nothing else that will do.... > The fact that many systems do not support "ftruncate" should explain > why the standard I/O library *can't* help you here. If you don't > have a name for a file, there *is* no portable way to truncate it to > zero length! Is there a portable way to truncate it to zero length if you *do* have a name for it? Creating for write won't cut it because of helpful systems like VMS that try to be nice by providing version numbers, and creating just creates a new version.... > The standard I/O library is not capable of performing miracles.... (It isn't? Bummer. :-) der Mouse (mouse@mcgill-vision.uucp)