Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A usable file synchronization algorithm  RSS feed

 
Sverre Moe
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a free, open source implementation I could use to compare files?

Not being satisfied with JFileSync I have begun creating my own program to do file synchronization between a source and target folder. Also because I thought it could be fun to try create such a program.

I was thinking of a fully implemented algorithm for file comparison that could easily be integrated into another program, an API of some sort.

No point in creating a comparison algorithm if there already exist one that could be used.

If I had to create such an algorithm I was thinking about creating a tree like data structure to keep a reperesentation of the file and directory structure. Each node in the tree would contain a File object. Comparison would then be done by traversing the tree, level for level. I think JFileSync uses a recursive algorithm in the comparison process. I have learned that a recursive algorithm could give a performance bottleneck. Perhaps that's why JFileSync is so slow to analyze a source and target against each other.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!