FileSystemWatcher and Word file

P

piola vago

I'm making an application that monitor a particular file (not a
directoy) and when trigger a change event it start a backup process of
the changed file. I'm using FileSystemWatcher component. My problem is
that i cannot start the backup process until the word file is closed.
I think this is caused because Word application saves changes in a
temporary file, and the changes are mapped to the REAL file only after
closing de Word application, can anybody confirm or refuse this??? Is
my only chance to wait until the MS Word app is closed??? and in that
case is there anyway to know when the application is closed beside and
infinite loop (or similar) asking if the file is open????

I will appreciate if anyone could help me!!!!!
 
J

Jay Parzych

the temp file will have a name like this:

~$_1974_07_19.doc

in the first 2 characters

The temp file will be removed when the actual file is closed
 
R

Robson Siqueira

piola,

when the file changes, start a new loop in which you try to open the file
exclusively for write. When that happens, it means that your file was
closed.
 

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