FileSystemWatcher and Word file

  • Thread starter Thread starter piola vago
  • Start date Start date
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!!!!!
 
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
 
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.
 
Back
Top