Re: file comparing

new topic     » goto parent     » topic index » view thread      » older message » newer message

-----Original Message-----
From: Greg Phillips <i.shoot at REDNECKS.COM>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Sunday, January 03, 1999 3:12 PM
Subject: file comparing


>I wrote this little program a little while back, because I needed
>something that worked like the old DOS program, compare.  This works
>great, until you try to compare two large files (I assume because the
>program runs out of memory).  Is there any way I can avoid this?
>
>I know I could use getc(), but wouldn't that also be really slow, for
>large files?


Why don't you use getc() to read in chunks of data (from each file
individually), say 100k to 500k, compare those and then get the next chunks
from the files and so on on?
 According to library.doc the length of an open file can be determined by :
file_length = seek(file_id,  -1 )
You may need this info to implement this suggestion.

michael at igrin.co.nz

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu