473,761 Members | 9,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileSystemWatch er Created Event Triggers Early

I have a FileSystemWatch er 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 FileSystemWatch er was triggered only on the beginning
of the process.

Is it possible to use the FileSystemWatch er to trigger when a file is
created and not just conceived?
Jul 21 '05 #1
2 2429
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 FileSystemWatch er 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 FileSystemWatch er was triggered only on the beginning
of the process.

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

Jul 21 '05 #2
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 FileSystemWatch er 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 FileSystemWatch er was triggered only on the beginning
of the process.

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

Jul 21 '05 #3

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

Similar topics

2
2451
by: Jie | last post by:
H I use FileSystemWatcher.Changed event to capture an excel workbook being saved. Since the save button in excel is always enabled and each time click save the workbook is saved again and its modified time will be the current time. It seems that the file watcher changed event is not fired if the workbook has no changes since last save although the workbook last modified time has been changed. Any ideas Thank Jie
3
1593
by: Florida Development | last post by:
I have the need to monitor a directory for the arrival of files and then to run some processing on those new files. This is easy enough conceptually, the problem I have is that I get an event to handle when the file is first created yet is not fully written to the disk yet. Is there some simple way (that will pass a code review) that I can determine when the file write to disk has been completed so I can do my processing? Thank you.
2
371
by: Phil Galey | last post by:
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...
9
7129
by: Tushar | last post by:
Followup-To: microsoft.public.dotnet.general Does anyone know when is this event raised, is it: 1) When the file is created but may not have been closed 2) When the file is created AND it has been closed I am using this control in a Windows-Service I've developed. It works hoever the problem I'm having is that the file does not seem to be available when I receive this event. If I include a delay of a few seconds using Sleep(3000) for...
0
2438
by: Silver Oak | last post by:
Hi, I'm experimenting with FileSystemWatcher but it doesn't seem like it fires when a new file is created. Everytime I create a new file, it fires Changed event i.e. Case WatcherChangeTypes.Created never fires. Please point out my mistake. Thanks. Michael
1
2000
by: josh | last post by:
Hi, I have several independent, system components that write audit events to a database locally via ODBC and remotely via TCP, and I have a requirement to audit when the database is available for modification. First, does SQL Server have a concept of starting/stopping specific database instances? Or does my database instance "stop" only when the NT service MSSQLSERVER stops? Second, Oracle has system event triggers, e.g. AFTER...
2
1733
by: Ripley | last post by:
I am trying to find out exactly when this even fires when a file is "created" in a directory being monitored. That is, for a large file, that takes several minutes to upload, will the created event fire as soon as the file starts loading, or only when the file has been completely uploaded. I can't find any documentation to this at MSDN. Thanks, Ripley
0
1306
by: Alan Mailer | last post by:
After a user edits a Cell in one of my DataGridViews, I want to make sure what the user has typed in is 'valid'. If it's not, I want to Cancel the Edit. Ok, you say, use the CellValidating event for this. That's fine, I have... BUT... As you experts probably know, the CellValidating event triggers not just when a user EDITS a cell, but seemingly any time a Cell is selected. (Feel free to tell me I'm wrong about this, by the way).
2
2319
by: Shoaib Ahmed | last post by:
I have deleted the .MDF file accidently. I have never created a backup early on. Can any body tell me, where this MDF is gone after delete? I am using SQL Server 2000 Enterprise Manager.
0
9531
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.