Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best method to determine changed data in C++

I need to write a tool in C++ to determine the changed bits in a file compared against another file for replication. What would be the best method of accomplishing this?

I don't have a specific OS or library in mind, I'm open to suggestions. My primary goal is reducing the amount of network traffic involved in replicating.

like image 369
Chris Roland Avatar asked Nov 29 '22 07:11

Chris Roland


1 Answers

Look at rsync - it splits the file into blocks, calculates a checksum for each block, and transmits only the checksum to determine if there are any changesto the destination before transmitting the block data only if necessary.

like image 87
Martin Beckett Avatar answered Dec 06 '22 23:12

Martin Beckett