Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

File synchro question...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sven Rutten - 12 Nov 2006 21:16 GMT
Hello

I am coding an application which consists of a webservice and a client
application.
I am comparing the files on the server and the one on the client with
hash-code and dates, so I can synchronize. That is working correctly.

My problem is, if I am deleting one file on the client, then synchronize,
how does the server know that it has been deleted? Actually it is then
copying it back again to the client...

The problem occurs specially if I am using 2-3 clients to synchronize. If I
then delete the file on one client, but then make some changes to the file
on another client, then I am synchronizing client 1 and then client 2, it
should keep the new client 2-version!

So I should be able somehow to know when the file has been deleted...

Or is there another approach?

Thanks

Sven
Dale - 13 Nov 2006 06:14 GMT
It isn't real clear from your post if the server is writing directly to the
client or not or if the client is getting the file from the server and then
saving it. Without more information it is hard to say exactly but, assuming
it fits for your circumstance, the FileSystemWatcher class will allow you to
automatically detect when a file is changed, added, or deleted.

HTH

Dale
Signature

Dale Preston
MCAD C#
MCSE, MCDBA

> Hello
>
[quoted text clipped - 19 lines]
>
> Sven
Ciaran O''Donnell - 13 Nov 2006 13:24 GMT
You will need to have the app running all the time, probably as a service,
and use the FileSystemWatch to record all the changes. Then you can send all
lists to the server and let is figure out what to do to sync

Ciaran O'Donnell

> Hello
>
[quoted text clipped - 19 lines]
>
> Sven
Dale - 13 Nov 2006 20:14 GMT
Or you can take a mixed approach.  Use the FileSystemWatcher to catch
immediate changes and use a timer to trigger incremental scans of the watched
folders to check for changes made while the app is not running.  The latter
is similar to what Windows Media Player does.

Of course if  real time knowledge of changes is required and there are
serious financial or business implications then neither the FileSystemWatcher
or a triggered event may be adequate.  In those cases, it might be better to
manually check the file system before making whatever decisions in the
workflow are based on the file being changed or deleted or not.

Signature

Dale Preston
MCAD C#
MCSE, MCDBA

> You will need to have the app running all the time, probably as a service,
> and use the FileSystemWatch to record all the changes. Then you can send all
[quoted text clipped - 25 lines]
> >
> > Sven

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.