Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: ANSI draft - seeking to eof Message-ID: <6192@utzoo.UUCP> Date: Sat, 30-Nov-85 20:04:28 EST Article-I.D.: utzoo.6192 Posted: Sat Nov 30 20:04:28 1985 Date-Received: Sat, 30-Nov-85 20:04:28 EST References: <5400018@prism.UUCP> Organization: U of Toronto Zoology Lines: 13 > Does this really mean that there's no guaranteed way to seek to the end of > either a text or a binary stream in ANSI C (when such a beast exists)? Only the kludgey one: read the whole file, and do an ftell() when you hit the end; then you can seek back there. Maybe. Remember that many operating systems find it very difficult to do a seek in the Unix sense: their files simply do not support such an operation in any straightforward way. Most programs that want to do non-trivial file manipulation just cannot be written in such a way as to port to such machines gracefully. There is no good way around it. The minimal X3J11 semantics for seek reflect this. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry