473,884 Members | 2,319 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileSystemWatch er across the network

Hi all,
I have a file system watcher service that works fine on a local hard drive, but will not work across the network. I tried both: mapping the drive and "\\..." path both no luck. I don't receive any errors, it is just that FileSystemWatch er doesn't see any files dropped in the folder. What could be wrong?

Thanks
Goran
Sep 14 '06 #1
5 24231
Some basic troubleshooting steps:

1. Make sure the FileSystemWatch er's EnableRaisingEv ents property is set to true.
2. Make sure you have not set the FileSystemWatch er's Filter to ignore the type of files being dropped into the folder.
3. Make sure you have set the FileSystemWatch er's NotifyFilter to include to watch for Created files.
--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com
"Goran Djuranovic" <go************ **@newsgroups.n ospamwrote in message news:uA******** ******@TK2MSFTN GP03.phx.gbl...
Hi all,
I have a file system watcher service that works fine on a local hard drive, but will not work across the network. I tried both: mapping the drive and "\\..." path both no luck. I don't receive any errors, it is just that FileSystemWatch er doesn't see any files dropped in the folder. What could be wrong?

Thanks
Goran
Sep 14 '06 #2
Hi Mike,
Thanks for your response. Yes, all of those are set correctly.
Using this works fine:
With Me.FolderWatche rObj
.NotifyFilter = (NotifyFilters. FileName Or NotifyFilters.L astWrite Or NotifyFilters.L astAccess Or NotifyFilters.C reationTime Or NotifyFilters.S ize)
.Path = "C:\MyFolde r"
.Filter = "*.txt"
.IncludeSubdire ctories = False
.InternalBuffer Size = .InternalBuffer Size + 81920
.EnableRaisingE vents = True
End With

Using this doesn't work:
With Me.FolderWatche rObj
.NotifyFilter = (NotifyFilters. FileName Or NotifyFilters.L astWrite Or NotifyFilters.L astAccess Or NotifyFilters.C reationTime Or NotifyFilters.S ize)
.Path = \\MyServer\MyFo lder <---------- NOTE THE CHANGE
.Filter = "*.txt"
.IncludeSubdire ctories = False
.InternalBuffer Size = .InternalBuffer Size + 81920
.EnableRaisingE vents = True
End With

Goran

"Mike McIntyre" <mi****@getdotn etcode.comwrote in message news:Oc******** ******@TK2MSFTN GP02.phx.gbl...
Some basic troubleshooting steps:

1. Make sure the FileSystemWatch er's EnableRaisingEv ents property is set to true.
2. Make sure you have not set the FileSystemWatch er's Filter to ignore the type of files being dropped into the folder.
3. Make sure you have set the FileSystemWatch er's NotifyFilter to include to watch for Created files.
--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com
"Goran Djuranovic" <go************ **@newsgroups.n ospamwrote in message news:uA******** ******@TK2MSFTN GP03.phx.gbl...
Hi all,
I have a file system watcher service that works fine on a local hard drive, but will not work across the network. I tried both: mapping the drive and "\\..." path both no luck. I don't receive any errors, it is just that FileSystemWatch er doesn't see any files dropped in the folder. What could be wrong?

Thanks
Goran
Sep 14 '06 #3
Hi Goran,

I'm sorry that the documentation of FileSystemWatch er.InternalBuff erSize
didn't state very clear about the buffer size when monitoring network path.
It's recommended not exceeds 64K when monitoring network path.

FileSystemWatch er is basically a .Net wrapper for the Win32
ReadDirectoryCh angesW API. To use ReadDirectoryCh angesW, you create and
specify a buffer that the OS will populate with the changes. However, what
is not mentioned in the ReadDirectoryCh angesW documentation (but is hinted
in the FileSystemWatch er docs) is that the file system creates an internal
kernel buffer to store the change information temporarily until it has the
chance to update the user buffer. The size of the kernel buffer that is
created is the same size that is specified in ReadDirectoryCh angesW and is
created in non-paged pooled memory. Every time a FileSystemWatch er /
ReadDirectoryCh angesW is created / called, a new kernel buffer is also
created.

The kernel memory pools (paged and non-paged) are set aside in the system
address space for device drivers and other kernel components to use. They
grow and shrink dynamically as necessary. The current size of the pools
can be easily seen by going to the Performance tab of the Task Manager.
The pools will grow dynamically until they hit a maximum value which is
calculated at boot time and depends on available system resources (mostly
RAM). You do not want to hit this maximum value or else various system
services and drivers will start failing. However, this calculated maximum
value is not easily available. To determine the maximum pool sizes, you
need to use a kernel debugger. If you are interested in further
information about the system memory pools, I recommend that you look at
Chapter 7 in the MSPress book Inside Windows 2000 by Solomon and
Russinovich.

With this in mind, there is no recommendation on what size buffers you can
use. The current and maximum size of the system pools are going to be
varied from client to client. However, you probably should not go over 64k
for each FileSystemWatch er / ReadDirectoryCh angesW buffer. This stems from
the fact that there is a 64k limitation with network access as documented
in ReadDirectoryCh angesW. But in the end you are going to have to test the
application on a variety of expected target systems so that you can tune
your buffer.

There is overhead associated with .Net applications and I imagine that a
Win32 ReadDirectoryCh angesW program might be able to achieve better
performance with the same buffer size. However, with very fast and
numerous file changes, buffer overruns will be inevitable and the developer
is going to have to handle the case when an overrun occurs such as manually
enumerating the directory to detect the changes.

In conclusion, FileSystemWatch er and ReadDirectoryCh angesW are a
lightweight file change detection mechanism that is going to have its
limitations. Change Journals is another mechanism which we would consider
a medium-weight solution, but would still have limitations:

http://msdn.microsoft.com/library/en...e_journals.asp

Heavy-weight solutions would be to write a dedicated file system filter
driver that sits in the file system stack and monitors file system changes.
Of course this would be the most complex approach. Most virus scanners,
backup software, and file system monitoring utilities such as filemon
(www.sysinternals.com) implement a filter driver.

I hope above explanation helps you to understand the root cause of the
issue you're experiencing. Please reply to let us know whether or not you
need further information. Thank you.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 15 '06 #4
What Server OS is the target filesystem on? As far as I know, only Win95,
98, ME, XP, 2000, and 2003 support the FSW interface. NT 4 and earlier and
no version of Samba that I'm aware of support FSW.

Mike Ober.

"Goran Djuranovic" <go************ **@newsgroups.n ospamwrote in message
news:uA******** ******@TK2MSFTN GP03.phx.gbl...
Hi all,
I have a file system watcher service that works fine on a local hard drive,
but will not work across the network. I tried both: mapping the drive and
"\\..." path both no luck. I don't receive any errors, it is just that
FileSystemWatch er doesn't see any files dropped in the folder. What could be
wrong?

Thanks
Goran

Sep 15 '06 #5
Walter,
You were right on the target. Nothing else was wrong, but the
InternalBufferS ize. When I decreased it to 50K (51200B) worked like a charm.
It would not work above that size for that specific network connection.

Thanks a lot everyone
Goran Djuranovic
"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:5f******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Goran,

I'm sorry that the documentation of FileSystemWatch er.InternalBuff erSize
didn't state very clear about the buffer size when monitoring network
path.
It's recommended not exceeds 64K when monitoring network path.

FileSystemWatch er is basically a .Net wrapper for the Win32
ReadDirectoryCh angesW API. To use ReadDirectoryCh angesW, you create and
specify a buffer that the OS will populate with the changes. However,
what
is not mentioned in the ReadDirectoryCh angesW documentation (but is hinted
in the FileSystemWatch er docs) is that the file system creates an internal
kernel buffer to store the change information temporarily until it has the
chance to update the user buffer. The size of the kernel buffer that is
created is the same size that is specified in ReadDirectoryCh angesW and is
created in non-paged pooled memory. Every time a FileSystemWatch er /
ReadDirectoryCh angesW is created / called, a new kernel buffer is also
created.

The kernel memory pools (paged and non-paged) are set aside in the system
address space for device drivers and other kernel components to use. They
grow and shrink dynamically as necessary. The current size of the pools
can be easily seen by going to the Performance tab of the Task Manager.
The pools will grow dynamically until they hit a maximum value which is
calculated at boot time and depends on available system resources (mostly
RAM). You do not want to hit this maximum value or else various system
services and drivers will start failing. However, this calculated maximum
value is not easily available. To determine the maximum pool sizes, you
need to use a kernel debugger. If you are interested in further
information about the system memory pools, I recommend that you look at
Chapter 7 in the MSPress book Inside Windows 2000 by Solomon and
Russinovich.

With this in mind, there is no recommendation on what size buffers you can
use. The current and maximum size of the system pools are going to be
varied from client to client. However, you probably should not go over
64k
for each FileSystemWatch er / ReadDirectoryCh angesW buffer. This stems
from
the fact that there is a 64k limitation with network access as documented
in ReadDirectoryCh angesW. But in the end you are going to have to test
the
application on a variety of expected target systems so that you can tune
your buffer.

There is overhead associated with .Net applications and I imagine that a
Win32 ReadDirectoryCh angesW program might be able to achieve better
performance with the same buffer size. However, with very fast and
numerous file changes, buffer overruns will be inevitable and the
developer
is going to have to handle the case when an overrun occurs such as
manually
enumerating the directory to detect the changes.

In conclusion, FileSystemWatch er and ReadDirectoryCh angesW are a
lightweight file change detection mechanism that is going to have its
limitations. Change Journals is another mechanism which we would consider
a medium-weight solution, but would still have limitations:

http://msdn.microsoft.com/library/en...e_journals.asp

Heavy-weight solutions would be to write a dedicated file system filter
driver that sits in the file system stack and monitors file system
changes.
Of course this would be the most complex approach. Most virus scanners,
backup software, and file system monitoring utilities such as filemon
(www.sysinternals.com) implement a filter driver.

I hope above explanation helps you to understand the root cause of the
issue you're experiencing. Please reply to let us know whether or not you
need further information. Thank you.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your
reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Sep 15 '06 #6

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

Similar topics

3
2359
by: Jon | last post by:
Hi, in my program, i want to send a signal to other computer on the network (LAN). so that when other recieves this signal, it will do something... What Class should I use for sending the signal? Is there any example code i can find? thankyou very much in advance!
3
1982
by: Parag Gaikwad | last post by:
Hi, I need to delete files across the network using web client (IE 6.x) in Win 2003 - IIS 6.0 environment. Can someone please suggest an approach I can use to acheive this. Will using FSO do the job or I have to go COM way. Thanks in advance. Parag
4
3140
by: Sue | last post by:
Hello We have an application where the user would upload files (max size of 200 mb) from their client machine. This application will run on a web server (its a web server which would be used by the general public), because of obvious reason, this server will not have access to any shared directory on the network. Currently we store the file on the local drive (c:) of that server and an other application running on an internal server...
1
1445
by: AbeR | last post by:
I'm not sure that this the right forum, but here it goes. I wrote my first real win app in C# VS2003 and it ran famously on the dev machine and on the client machine. Copying the same exe onto a network drive and running it there I get and exception Application has generated an exception that could not be handled Process id = 0x844 (2116), Thread id=0x748 (1864) Same box only instead of a local drive a network drive. I'm perplexed....
0
1172
by: Pete | last post by:
I have a web asp.net 1.1 app that is using Windows Authentication on an Apache server. I cannot connect across the Intranet to another network even though there is a 'TRUST' setup between the network the server is on and the one I am trying to connect to. Do I still need to use impersonation within the web.config to gain access OR Is there some other way to allow the connection.
3
17058
by: =?Utf-8?B?U2Vhbk1hYw==?= | last post by:
How do I programmatically copy files across a network (from a local workstation to another local workstation on the network) using visual basic 2005? In other words, when in explorer and you enter a unc path to a network workstation, you are prompted with a dialog box asking for the user name and password that has access rights to that computer. After validating, you can access the files on the remote pc just like you can on your own pc,...
4
16108
by: Prof. William Battersea | last post by:
Hello, Suppose I have a Vista machine called VISTA and an XP machine called XP in a workgroup named WORKGROUP. Physically they're connected to a router and I can see lists of public and shared files on each of them. How do I address these for IO? A search suggested that the form open(r"\\server\folder\folder"), but I tried many combinations guessing what it wants for that path in my case (r"\\WORKGROUP\VISTA", "\\VISTA\PUBLIC", etc),...
1
1812
by: prakashwadhwani | last post by:
I have an app containing 9 forms which have approximately 2 to 3 combo boxes and 7 to 8 text boxes + a few labels (in each form). On the same PC the forms open very fast. However when I load the front end of the app on another PC across the network (100mbps), each form takes about 30 to 40 seconds to open the first time & subsequently approx 5 to 6 secs to open. The rowsource of the combo boxes are SQL statements as follows: combo1...
2
1876
by: KingKen | last post by:
what command do you use to send messages across a network from the command line interface? Also how do you use it?
0
9954
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
9799
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
10769
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
10869
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
9591
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
7985
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
7137
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
5808
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...
2
4231
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.