473,698 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileSystemWatch er events being reported when non should be

I have just started using the FileSystemWatch er in VB.NET. My first attempt
was to connect to a share, using unc paths, to a server running Win2000.
Everything was working great for about two days. Today, at about 6:30am
pst, the program stopped working. At first I thought it was the program, so
I put in some console.writeli ne statements to track the progress of the
program. What I found out appears to not be a problem with my program but
rather the server. As soon as my program starts and turns
..EnableRaising Events to true, it starts reporting files as being changed
which were in fact not changed. When I cancel the program and restart it,
it starts where it left off. It appears, for some reason, that the server
has queued these messages and is continuing to report the events.

Has anyone had this same problem? Does anyone know what I can do to keep
this from happening, or know why it happened in the first place? My first
thought was that the server drives were restored, but this is not the case.

Any help would be greatly appreciated.

fsw.Path = fPath 'fPath = "\\public1\data \html"
fsw.IncludeSubd irectories = True
fsw.EnableRaisi ngEvents = True
fsw.NotifyFilte r = fsw.NotifyFilte r Or NotifyFilters.F ileName Or
NotifyFilters.L astWrite Or NotifyFilters.S ize

Private Sub fsw_All(ByVal sender As Object, ByVal e As FileSystemEvent Args)
Handles fsw.Created, fsw.Changed, fsw.Deleted
Dim changeType As String = [Enum].GetName(GetTyp e(WatcherChange Types),
e.ChangeType)
Try
If changeType.ToLo wer = "deleted" Then
fl.log(e.FullPa th & "||" & changeType & "|" & Now())
Else
If Not CBool(File.GetA ttributes(e.Ful lPath) And FileAttributes. Directory)
Then
fl.log(e.FullPa th & "||" & changeType & "|" & Now())
End If
End If
Catch
End Try
End Sub

Private Sub fsw_renamed(ByV al sender As Object, ByVal e As RenamedEventArg s)
Handles fsw.Renamed
'If Not CBool(File.GetA ttributes(e.Ful lPath) And FileAttributes. Directory)
Then
fl.log(e.OldFul lPath & "|" & e.FullPath & "|renamed" & "|" & Now())
'End If
End Sub
Jul 21 '05 #1
1 1273
I found out a bit more information. It turns out that Norton AntiVirus was
performing a scan, but I am not sure if the scan was going on during the
time I noticed the problem. I am still wondering what type of change was
being done by the scan that would cause an event to be reported and what the
event was? Is there something that I can do to ignore those events or know
what process caused the event?

"Glenn" <gl************ **********@yaho o.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I have just started using the FileSystemWatch er in VB.NET. My first attempt was to connect to a share, using unc paths, to a server running Win2000.
Everything was working great for about two days. Today, at about 6:30am
pst, the program stopped working. At first I thought it was the program, so I put in some console.writeli ne statements to track the progress of the
program. What I found out appears to not be a problem with my program but
rather the server. As soon as my program starts and turns
.EnableRaisingE vents to true, it starts reporting files as being changed
which were in fact not changed. When I cancel the program and restart it,
it starts where it left off. It appears, for some reason, that the server
has queued these messages and is continuing to report the events.

Has anyone had this same problem? Does anyone know what I can do to keep
this from happening, or know why it happened in the first place? My first
thought was that the server drives were restored, but this is not the case.
Any help would be greatly appreciated.

fsw.Path = fPath 'fPath = "\\public1\data \html"
fsw.IncludeSubd irectories = True
fsw.EnableRaisi ngEvents = True
fsw.NotifyFilte r = fsw.NotifyFilte r Or NotifyFilters.F ileName Or
NotifyFilters.L astWrite Or NotifyFilters.S ize

Private Sub fsw_All(ByVal sender As Object, ByVal e As FileSystemEvent Args) Handles fsw.Created, fsw.Changed, fsw.Deleted
Dim changeType As String = [Enum].GetName(GetTyp e(WatcherChange Types),
e.ChangeType)
Try
If changeType.ToLo wer = "deleted" Then
fl.log(e.FullPa th & "||" & changeType & "|" & Now())
Else
If Not CBool(File.GetA ttributes(e.Ful lPath) And FileAttributes. Directory)
Then
fl.log(e.FullPa th & "||" & changeType & "|" & Now())
End If
End If
Catch
End Try
End Sub

Private Sub fsw_renamed(ByV al sender As Object, ByVal e As RenamedEventArg s) Handles fsw.Renamed
'If Not CBool(File.GetA ttributes(e.Ful lPath) And FileAttributes. Directory)
Then
fl.log(e.OldFul lPath & "|" & e.FullPath & "|renamed" & "|" & Now())
'End If
End Sub

Jul 21 '05 #2

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

Similar topics

1
3329
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 documentation states that if more than one file is copied to the folder at the same time, a cache will queue them up for processing, but when I drop 3 files into this folder, only the 1st (sometimes the first two) cause the event to fire. Thanks, Troy
3
14292
by: Stampede | last post by:
Hi, I want to use the FileSystemWatcher in a Windows Service. I read an article, where the author created the FileSystemWatcher object in a seperate thread and when the event is fired, he started a working thread for processing the file, created a new FileSystemWatcher (as he said for real time processing), and then called the join method for the first thread. I can't really see the sence in this. Aren't the events of the...
1
1583
by: yogesh | last post by:
hello I getting problem in FileSystemWatcher , I had wrriten the code for the FileSystemWatcher , when i dropping the new file in the directory , the WatcherEdi_Created event get fired , but some time it not get fired. also this happens with muliple files dropping in same folder . the count of events not equal to number of files droped.Follwing i scode snippet. please do the needfull for me. thank in advance.
1
299
by: Glenn | last post by:
I have just started using the FileSystemWatcher in VB.NET. My first attempt was to connect to a share, using unc paths, to a server running Win2000. Everything was working great for about two days. Today, at about 6:30am pst, the program stopped working. At first I thought it was the program, so I put in some console.writeline statements to track the progress of the program. What I found out appears to not be a problem with my program...
0
8674
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...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9026
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8893
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
8861
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
5860
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();...
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
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.