www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/05/19:45:09

From: "Eric" <eric AT replytogroup DOT net>
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: <asor6v$1k4$1@news5.svr.pol.co.uk>
References: <asok7c$tj8$1 AT news7 DOT svr DOT pol DOT co DOT uk> <h5mvuu4q16qefkd7soj7svfj8o0m1eopf5 AT 4ax DOT com>
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
> <sorry AT not DOT com> 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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019