Path: utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: is struct stat buf.st_size always correct? Message-ID: <12573@smoke.BRL.MIL> Date: 13 Apr 90 05:28:42 GMT References: <21501@joshua.athertn.Atherton.COM> <7751@jpl-devvax.JPL.NASA.GOV> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 8 In article <7751@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >Why use fread? Why not a normal open and a normal read? It would be >less overhead. On many systems (though not 4.0.3, I think), this has to >yank the file a piece at a time through the stdio buffers. However, if you use read(), you should write the code to loop on the read() for the as-yet unread portion of the file until you get it all or a 0 is returned. fread() takes care of this for you.