By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

FileSystemWatcher Created Event Triggers Early

P: n/a
I have a FileSystemWatcher that triggers when a PDF file is created.
However, the creation of the PDF file is about a 7 or 8 second process ... I
cannot refer to the file during that time because it does not yet exist. If
I set up a loop using the Sleep API call, it loops forever and the software
that creates the PDF file stops progressing and the file never finishes
getting created. The FileSystemWatcher was triggered only on the beginning
of the process.

Is it possible to use the FileSystemWatcher to trigger when a file is
created and not just conceived?
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi

Well you can try monitering both the Created and the Changed events of the FileWatcher for the PDB File.

The documentation of the Changed event states
The change of a file or folder. The types of changes include: changes to size, attributes, security settings, last write, and last access time.

So this event will fire when there is change to *size* which should happen after the process of compilation is compelete.
--
Regards,
Saurabh Nandu
Master C#, the easy way...
[ www.MasterCSharp.com ]

"Phil Galey" wrote:
I have a FileSystemWatcher that triggers when a PDF file is created.
However, the creation of the PDF file is about a 7 or 8 second process ... I
cannot refer to the file during that time because it does not yet exist. If
I set up a loop using the Sleep API call, it loops forever and the software
that creates the PDF file stops progressing and the file never finishes
getting created. The FileSystemWatcher was triggered only on the beginning
of the process.

Is it possible to use the FileSystemWatcher to trigger when a file is
created and not just conceived?

Jul 21 '05 #2

P: n/a
Hi

Well you can try monitering both the Created and the Changed events of the FileWatcher for the PDB File.

The documentation of the Changed event states
The change of a file or folder. The types of changes include: changes to size, attributes, security settings, last write, and last access time.

So this event will fire when there is change to *size* which should happen after the process of compilation is compelete.
--
Regards,
Saurabh Nandu
Master C#, the easy way...
[ www.MasterCSharp.com ]

"Phil Galey" wrote:
I have a FileSystemWatcher that triggers when a PDF file is created.
However, the creation of the PDF file is about a 7 or 8 second process ... I
cannot refer to the file during that time because it does not yet exist. If
I set up a loop using the Sleep API call, it loops forever and the software
that creates the PDF file stops progressing and the file never finishes
getting created. The FileSystemWatcher was triggered only on the beginning
of the process.

Is it possible to use the FileSystemWatcher to trigger when a file is
created and not just conceived?

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.