delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/28/23:23:39

Sender: M DOT A DOT Bukin AT inp DOT nsk DOT su
To: djgpp AT delorie DOT com
Subject: Re: read / write errors
References: <684pm4$9ta AT mtinsc05 DOT worldnet DOT att DOT net>
From: Michael Bukin <M DOT A DOT Bukin AT inp DOT nsk DOT su>
Date: 29 Dec 1997 09:58:54 +0600
In-Reply-To: "Steve Patton"'s message of Sat, 27 Dec 1997 22:55:48 -0700
Message-Id: <207m8o241t.fsf@Sky.inp.nsk.su>
Lines: 26

"Steve Patton" <leaphe AT pemail DOT net> writes:

> I am making an archive program, that uses (has nothing to do with the
> problem, but is using Allegro Compression Routines).  And here's what I do.
> 
> char buf[100000];
> 
> t = findfirst ( "*.*", &f, FA_ARCH|FA_RDONLY);
> while ( !t )
>  {
>     [gets info, and writes it to archive file]
> 
>     int handle = open ( f.ff_name, O_RDONLY );
>     for ( int tcount = read ( handle, buf, 100000 ) ; tcount ;  )

  tcount can be `-1' in case of error.

>       {
>         [writes file to archive, using allegro routines]
>         tcount = read ( handle, buf, 100000 );
>       }
>    close ( handle );

  Do you use findnext here?

>  }

- Raw text -


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