473,387 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

FileSystemWatcher and Word file

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!!!!!

Jan 23 '07 #1
2 2363
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

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!!!!!

Jan 23 '07 #2
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.

--
Regards,
Robson Siqueira
Enterprise Architect
"piola vago" <fr*************@gmail.comwrote in message
news:11*********************@a75g2000cwd.googlegro ups.com...
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!!!!!

Jan 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jlea | last post by:
I'm trying to watch a file from my XP-Pro workstation to either a Win2000 or a NT4 machine and everytime I try to set the path property to something such as \\PDC1\cdrive\ I get a...
3
by: zfeld | last post by:
My app is creating a word document which my app calls saveas() and saves it to a given directory that is being watched by a fileSystemWatcher. The problem is that the fileSystemEventHandler for...
1
by: Troy Murphy | last post by:
How do I prevent the FileSystemWatcher event to keep firing while the file is being created? When copying a file to the watched folder, the event fires a dozen or more times! Also, the...
7
by: Allen Anderson | last post by:
I'm trying to figure out a way to catch when a file has been written to a directory. I currently have it where I can catch when the file begins writing, but this isn't helpful as I need to know...
3
by: Sagaert Johan | last post by:
I have a program that uses the filesystemwatcher. Problem is that i have to wait until the file is closed before i can do someting with it in the changed event. How can i detect if the...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
12
by: ljh | last post by:
Has anyone else noticed that the FileSystemWatcher raises the changed event twice when a file is changed? Do you have any idea why this is the case?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.