Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to "Compare File"?

Status
Not open for further replies.

hstijnen

Programmer
Nov 13, 2002
172
NL
Hi,

How can I compare files on disk? I can't find in the CBuilder file routines.

Thanks

Henk
 
ASAIK, niether C++ nor Builder have a pre-built routine to compare files. You could write your own and compare the files byte by byte.

James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
I suggested myself to use a system command, but I don't know how to catch the result.

Henk
 
If everything had a precoded function to accomplish every task then why are we struggling so hard to learn these arcane arts.

tomcruz.net
 
Actually i think that it might be a bigger programming job to interpete the output of the "FC.EXE" program.

It's really quite simple:
1: Open the two files.
2: Check file sizes/dates and such.
3: Load all or a portion of both into memory depending on size.
4: do a byte-wise compare.
5: If no difference exist repeat 3 & 4 untill the datas are all compared.

Now You know!!!

Totte
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top