Scenario: I want to develop an application.The application should be able to connect to my remote server and download data to the local disk , while downloading it should check for new files and only download the new ones simultaneously creating the required(new) folders.
What am i doing?: The app first checks for internet connection , if available pings the server to check if the server is active.Then it has to download the new files.
Problem: I have no idea how to compare the files in the server with the ones in the local disk.How to download only the new files from the server to the local disk?
What am thinking?: If i can create the exact folder structure(hierarchy) in the local disk as it is in the server…than i can download the new files accordingly to folders by maintaining some index file in both server and local disk.
Kindly help me guys..spare out some time..its urgent…Thanks.
Why reinvent
rsync?If you want to insist on rolling your own, checking for differing filestamp between files or comparing md5 hashes of the content would probably be a good start.