need ideas - how to determine when another machine has persisted a file

M

marfi95

Basically, I keep the state of some objects serialized in an xml file
through the use of a data set. The xml file serialized is persisted
onto a shared network drive. However, the file is only deserialized
upon startup.

I'd like to automatically refresh the state of my objects when other
users have changed their state through this same persisted file. What
is the best way to determine when this has happened ? Continually run
a timer and check if the persisted file has changed and once it has
changed, deserialize the file again ? Run a background thread and
constantly check ? I'm looking for any ideas on how to accomplish
this.

I guess I envision this working similar to the way explorer works in
windows. For example, if you have a directory open and someone else on
the network deletes/adds a file, your directory view is automatically
refreshed.

Any ideas ?
Mark
 
R

Ray Cassick \(Home\)

I would think that using a fileSystemWatcher would be good for this. You
would get an event each time the file was updated and then you can
re-de-serialize it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top