G
Glenn
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 but
rather the server. As soon as my program starts and turns
..EnableRaisingEvents 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.IncludeSubdirectories = True
fsw.EnableRaisingEvents = True
fsw.NotifyFilter = fsw.NotifyFilter Or NotifyFilters.FileName Or
NotifyFilters.LastWrite Or NotifyFilters.Size
Private Sub fsw_All(ByVal sender As Object, ByVal e As FileSystemEventArgs)
Handles fsw.Created, fsw.Changed, fsw.Deleted
Dim changeType As String = [Enum].GetName(GetType(WatcherChangeTypes),
e.ChangeType)
Try
If changeType.ToLower = "deleted" Then
fl.log(e.FullPath & "||" & changeType & "|" & Now())
Else
If Not CBool(File.GetAttributes(e.FullPath) And FileAttributes.Directory)
Then
fl.log(e.FullPath & "||" & changeType & "|" & Now())
End If
End If
Catch
End Try
End Sub
Private Sub fsw_renamed(ByVal sender As Object, ByVal e As RenamedEventArgs)
Handles fsw.Renamed
'If Not CBool(File.GetAttributes(e.FullPath) And FileAttributes.Directory)
Then
fl.log(e.OldFullPath & "|" & e.FullPath & "|renamed" & "|" & Now())
'End If
End Sub
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 but
rather the server. As soon as my program starts and turns
..EnableRaisingEvents 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.IncludeSubdirectories = True
fsw.EnableRaisingEvents = True
fsw.NotifyFilter = fsw.NotifyFilter Or NotifyFilters.FileName Or
NotifyFilters.LastWrite Or NotifyFilters.Size
Private Sub fsw_All(ByVal sender As Object, ByVal e As FileSystemEventArgs)
Handles fsw.Created, fsw.Changed, fsw.Deleted
Dim changeType As String = [Enum].GetName(GetType(WatcherChangeTypes),
e.ChangeType)
Try
If changeType.ToLower = "deleted" Then
fl.log(e.FullPath & "||" & changeType & "|" & Now())
Else
If Not CBool(File.GetAttributes(e.FullPath) And FileAttributes.Directory)
Then
fl.log(e.FullPath & "||" & changeType & "|" & Now())
End If
End If
Catch
End Try
End Sub
Private Sub fsw_renamed(ByVal sender As Object, ByVal e As RenamedEventArgs)
Handles fsw.Renamed
'If Not CBool(File.GetAttributes(e.FullPath) And FileAttributes.Directory)
Then
fl.log(e.OldFullPath & "|" & e.FullPath & "|renamed" & "|" & Now())
'End If
End Sub