Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need a program which gives file name under editing mode. I am making backup program and I need to find difference between file before editing and file and file after editing.

File locking is not problem with me.
Posted
Comments
Sandeep Mewara 30-Sep-12 2:38am    
And where are you stuck while trying to make such program?
Member 4643583 30-Sep-12 12:38pm    
I need algorithm to generate delta of modified content. Algo if we compare complete backup file then itt consume high network bandwidth.
This is my problem.

1 solution

In my opinion there's two things you could do.
First, and possibly preferent, you could compare the date at which a file was last edited with the date of the file in your backup system. If the file on the machine is newer than the one in your backup system you need to back it up. If a file is not present in your backup system at all you need to back it up too.
Second, you could use a FileSystemWatcher[^] to be notified the moment a file is created, updated, deleted etc.
How you are going to realize any of these (or other methods) is up to you.
Hope it helps! :)
 
Share this answer
 
Comments
Member 4643583 30-Sep-12 12:36pm    
Yes but i need a alorithm to gerenate delta of difference between previously backed file and new file.
Member 4643583 30-Sep-12 12:39pm    
I need algorithm to generate delta of modified content. Algo if we compare complete backup file then itt consume high network bandwidth.
This is my problem.
Sander Rossel 30-Sep-12 17:03pm    
Sorry, that's not what I understood from your question. Anyway, if all you need to do is backup files I'd say the only thing you need to send through the network is the date of the file and the file if the dates differ. AFTER you've compared the dates you can send the file and compare it. I can't help you with the algorithm necessary to compare two files. This is specialized work and if I could do it I would probably be making a lot more money at some big company :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900