delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/30/03:48:09

From: "Steve Patton" <leaphe AT pemail DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: read / write errors
Date: Tue, 30 Dec 1997 01:42:35 -0700
Organization: AT&T WorldNet Services
Lines: 39
Message-ID: <68ac6v$idf@bgtnsc02.worldnet.att.net>
References: <684pm4$9ta AT mtinsc05 DOT worldnet DOT att DOT net> <207m8o241t DOT fsf AT Sky DOT inp DOT nsk DOT su>
NNTP-Posting-Host: 12.67.33.230
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Michael Bukin wrote in message <207m8o241t DOT fsf AT Sky DOT inp DOT nsk DOT su>...
>"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?




Yes I did, sorry, I forgot to add that, I didn't snip my code, I just
rewrote basically what it was doing (except for the findnext of course).

-Steve


- Raw text -


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