Solved

Best way to synchronize 2 folders

Posted on 2006-11-01
3
194 Views
Last Modified: 2010-04-23
Hi experts

i have to make a program that synchronize 2 folders
but i'm asking if there is a smart way to do this because the only way i know if to loop throught all files in one folder and check if exist in the other
but when the program crash in the middle thread, i have to loop from the beginning, that's not very handy...

so i'm sure there is a way to make this smartly...

please let me know how you will do this if you have to sync 2 folders smartly

any suggestion are welcome...

regards

0
Comment
Question by:Dnx_7
3 Comments
 
LVL 10

Assisted Solution

by:ericwong27
ericwong27 earned 50 total points
ID: 17849216
Hi,

If the coding is not the "must-do" then try to use SyncToy v1.4 (Freeware from Microsoft)

http://www.microsoft.com/downloads/details.aspx?familyid=E0FC1154-C975-4814-9649-CCE41AF06EB7&displaylang=en
0
 
LVL 5

Accepted Solution

by:
DEEPESH earned 450 total points
ID: 17849363
I don't know what you have code but if i have to do it i would do it in this manner
You can use FileSystemWatcher and whenever changes take palce in the folder, start copying,
Second check each file through io.File.Exists on destination path, if not then use io.file.copy

Visit the links it may help
http://vbnet.mvps.org/index.html?code/fileapi/copyfile.htm
http://dotnetjunkies.com/Forums/ShowPost.aspx?PostID=1547

I think what you are doing is correct
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 17859340
thank you guys...
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now