Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!brutus.cs.uiuc.edu!tut.cis.ohio-state.edu!att!oucsace!bchurch From: bchurch@oucsace.cs.OHIOU.EDU (Bob Church) Newsgroups: comp.lang.c Subject: comp.lang.c Keywords: fread, Message-ID: <744@oucsace.cs.OHIOU.EDU> Date: 28 Aug 89 04:14:33 GMT Organization: Ohio University CS Dept., Athens Lines: 15 I've just started reading this newsgroup so forgive me if this is an old question. I am trying to get the return value of fread into a variable. The following line while (rtns = (fread(buf,5,10,ioptr)) == 10) rtns being an integer works as long as their are 50 byte chunks of data left to be read. The problem is that the value that I then in rtns after each pass is either 1 if successful or 0 on the last pass when the data has all been read. How can I get the actual number of items read into a variable that I can then use in the fwrite command? Thanks, Bob Church att!oucsace!bchurch or CS656@OUACCVMB on the Bitnet