Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!oliveb!pyramid!batcomputer!braner From: braner@batcomputer.UUCP Newsgroups: comp.sys.atari.st Subject: Re: read past EOF? Message-ID: <1289@batcomputer.tn.cornell.edu> Date: Sun, 7-Jun-87 09:55:18 EDT Article-I.D.: batcompu.1289 Posted: Sun Jun 7 09:55:18 1987 Date-Received: Mon, 8-Jun-87 03:51:46 EDT References: <1987@ihuxy.ATT.COM> Reply-To: braner@tcgould.tn.cornell.edu.UUCP (braner) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 11 Keywords: read, bug, gemdos, megamax Summary: get the file size attribute first [] When I buffer I/O myself (see the source code for my uu*code, MORE, etc) (oops: those are in AL, not C!) (In C: my version of microEMACS) I first read the file attributes (using Setdta() and Fsfirst()) and isolate the file size. Later, when reading the file in chunks (of 4.5 or 9 or 18K) I keep track of the amount remaining to be read. In the last call to Fread() I only ask for the amount that I know is there! (Why all the trouble? - 'cause this is _much_ faster than using the byte-by-byte UNIX-like fopen(),fread()...) - Moshe Braner