Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check difference from 2 binary files
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00522969
Message ID:
00522978
Vues:
10
Hi!

FC wih option /B does the same. Just try it. Anyway, if you want, I can send you a quick memo/string scanning algorithm for VFP that you can use to compare 2 long strings (files read into the VFP string).

I do not know any other VFP tools or Windows tools to compare 2 biinary files.

What is the problem, anyway? Did you tried something like following:
#DEFINE nChunks 128
&& adjust chunk size for the best performance. It is very depended on the probability of differences.

&& do following in a loop until eof
lcTemp1 = fread(nFile1Handle,nChunks)
lcTemp2 = fread(nFile2Handle,nChunks)
if !(lcTemp1==lcTemp2)
  && compare them byte by byte
  i = 0
  for i=1 to min(len(lcTemp1),len(lcTemp2))
    if !(substr(lcTemp1,i,1)==substr(lcTemp2,i,1))
      ReportDifference(lnGlobalPosition+i,substr(lcTemp1,i,1),substr(lcTemp2,i,1)) && wriet the difference
    endif
  endfor
endif

lnGlobalPosition = lnGlobalPosition + i
Anyway, above is similar to what the FC does...

HTH.

>FC is not the correct tool.
>The compare is byte/byte at the same position in the file.
>
>Enrico
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform