Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check difference from 2 binary files
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00522969
Message ID:
00522978
Views:
9
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform