From: "Eric" Newsgroups: comp.os.msdos.djgpp Subject: Re: Files fread() in and fread() out get garbled Date: Fri, 6 Dec 2002 00:32:15 -0000 Lines: 37 Message-ID: References: NNTP-Posting-Host: 62.137.118.158 X-Trace: news5.svr.pol.co.uk 1039134751 1668 62.137.118.158 (6 Dec 2002 00:32:31 GMT) NNTP-Posting-Date: 6 Dec 2002 00:32:31 GMT X-Complaints-To: abuse AT theplanet DOT net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "J. L." > [snip code] > > I see this message also in clc. There are 1 useful advice from Jim > about your split function. > > [snipet reproduced from clc] > > >> unit = FLOPPY_CAPACITY; > >> > > > { > char *tbuffer = buffer; > >> while (size) { > >> *fname = *name++; > >> f = fopen(fname, "wb"); > >> if (f == NULL) { > >> error(FILE_IO); > >> } > >> puts("Writing..."); > > >> - bytes = fwrite(buffer, 1, unit, f); > + bytes = fwrite(tbuffer, 1, unit, f) > + tbuffer += FLOPPY_CAPACITY; > > You are allways writing to yours *n* diskettes the same first > FLOPPY_CAPACITY bytes of file to split. Change the code acording Jim's > advice. Oops. I see what you mean. But I didn't quite understand Jim's post, so thanks for clearing that up for me. Eric