473,327 Members | 2,016 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,327 software developers and data experts.

FileSystemWatcher OnChanged

D2
Hi,

I'm using FileSystemWatcher to monitor certain folders in file system.
In some specific scenarios where a large file is copied to the
monitored folder, I receive too many Onchanged events. I'm clueless as
how can i detect the file has finally been copied? any help would be
appreciated.

thanks,
d2
Jan 20 '08 #1
1 1354
You can't know for sure. You can't even know if the two OnChanged events
were the result of the same action or the same application.

The best you can do is timeout after a certain amount of time without
receiving OnChanged. e.g. when you get an OnChanged for a file, set a timer
for 500 ms. If you get another OnChanged event, reset that timer. When the
Elapsed event for the timer is raised, you know nothing has changed the file
in 500ms and whatever action that was being performed might be completed.

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"D2" wrote:
Hi,

I'm using FileSystemWatcher to monitor certain folders in file system.
In some specific scenarios where a large file is copied to the
monitored folder, I receive too many Onchanged events. I'm clueless as
how can i detect the file has finally been copied? any help would be
appreciated.

thanks,
d2
Jan 21 '08 #2

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

Similar topics

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...
0
by: Erik Herje via .NET 247 | last post by:
Hi, I have a Windows Service written in C# whos purpose is to sniff a folder to look for changes in the folder. If a file is created or changed, it should get its name and start an object the...
0
by: zfeld | last post by:
My program has two instances of a control have fileSystemWatchers that are set to monitor the same directory for changes. When they are watching a directory on the local machine, it works fine, two...
1
by: TD | last post by:
I'm watching a folder for new files. When the files arrive, I want to wait until it is done being written to and then move it. Every time I move a file into the test folder, it triggers 3 calls...
0
by: Peter Kirk | last post by:
Hi I am trying to use FileSystemWatcher to watch for changes in a directory. The problem I am exepriencing is a double firing of an OnChanged event when a file is opened, edited, and saved. Why...
1
by: Peter Kirk | last post by:
Hi I am trying to use FileSystemWatcher to watch for changes in a directory. The problem I am exepriencing is a double firing of an OnChanged event when a file is opened, edited, and saved. Why...
0
by: Andreas Reisenhofer | last post by:
Hallo VB.NET's We are trying to use FindFirstChangeNotification under VB6 and FileSystemWatcher with vb.net and got no success on drives mapped with InterDriveClient (5.0,7.11) on a NetApp...
1
by: PointMan | last post by:
there is class A... class A { FileSystemWatcher watcher; public void Start() { fs= new FileSystemWatcher(); fs.Path = "C:\TEMP";
4
by: Andrus | last post by:
To reporoduce, run the code. Observed: Form is shown Expected: message box should displayed. How to fix ? Andrus.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.