FileSystemWatcher WinXP versus Win2003



Hi,
I have a C# program which creates a FileSystemWatcher and sets
IncludeSubdirectories property to true with filter set to "*.txt". The
program runs fine under WinXP but in Win2003, it does not always work.
specifically another program is writing into the directory being
monitored by my app. When i do a copy from command prompt into the
directory, my app picks it up. But when the other app writes a file into
the directory being monitored, my app does not. All the testing i have
done with my app on XP involved the copying of the file or opening it
using notepad and saving it back. The NotifyFilter is set to LastWrite.
But i am capturing the Created and Changed events using:
_fsWatcher.Created += new FileSystemEventHandler(someFunc)
_fsWatcher.Changed += new FileSystemEventHandler(someFunc)
where the someFunc is defined as a private void.
The copy does not work on the Win2003 but when i use notepad to save the
file on win2003, my app sees the event. I want my program to capture the
first time creation of the file on the directory and not when i use
notepad to save it.
Any ideas why the difference?
thanks,
BRAMOIN

*** Sent via Developersdex http://www.developersdex.com ***
.



Relevant Pages

  • Re: Re: RE: System error when trying to print
    ... Uninstalling the app does not ... >> have no choice but to re-install Windows XP and start fresh. ... Publisher, notePad, plus a "test print" from the printer properties. ... I got the error message with all of them. ...
    (microsoft.public.windowsxp.print_fax)
  • Re: The performance of Editplus is much better than notepad,Why?
    ... Concerns about how many MB of memory you are using are misplaced. ... with EVERY app, or the two dozen or so other DLLs typically loaded by all apps. ... memory when just opening it wihout opening any diary file,like notepad. ... Why editplus costs so less memory?And why notepad costs so much? ...
    (microsoft.public.vc.mfc)
  • Re: how to stop my app from closing
    ... so that my app gets shutdown after Notepad and other apps. ... SessionEnded event won't help because my app will probably be closed before ... SessionEndingEventArgs e) ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: FileSystemWatcher WinXP versus Win2003
    ... still in used by the originator). ... my app picks it up. ... But i am capturing the Created and Changed events using: ... The copy does not work on the Win2003 but when i use notepad to save the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: determining window status
    ... If the user minimizes notepad I want to minimize my app also. ... If he restores it, I also want to restore my app. ... Setting my app as the child seems to be much more problematic. ...
    (microsoft.public.vb.general.discussion)