Re: HELP! - FileSystemWatcher Problems

From: Frankie (JimM_at_nospam.com)
Date: 01/11/05


Date: Tue, 11 Jan 2005 06:07:14 -0600

kmcnet,
I had this problem, and the way that I worked around the problem was
creating two separate arraylists, one to monitor the events, the other was
used to process the items. When the event came in, I updated the arraylist
using the filename as the key. I used a timer to set a delay on the
processing and once things stabilized, just a few seconds, I moved my
"monitored" items into my queue and processed them. This may not be the best
way of doing things, actually, I don't really like the way I did it, but, it
worked. You may be able to tell if the file is finished by opening the file
exclusively, if you can then you know that something still has a handle on
it and suspend your processing. Remember to set the NotifyFilter property
to only those events you're interested in. hth

"kmcnet" <kmcnet@discussions.microsoft.com> wrote in message
news:A516C2F4-CF82-4DF3-97A5-852B08093288@microsoft.com...
> Hello Everyone and thanks for your help in advance. I have been battling
> a
> problem for nearly a month with the FileSystemWatcher component.
> Basically,
> what I am trying to do it to monitor three separate folders on a Windows
> 2000
> server for activity. In my code, I have set up three separate
> subroutines:
>
> FaxWatch()
> ReportWatch()
> ScheduleWatch()
>
> Each of the subroutines creates a new instance of the FileSystemWatcher.
> However, I am running into a number of issues. First and most problematic
> is
> that when I create two instances of the component, it seems to work, but a
> third one stops all monitoring entirely (for example, calling the
> ScheduleWatch() routine). Additionally, some of the files written to the
> directory are somewhat large, and I need to figure out a way to wait for
> the
> file to be completely written before taking action. I have tried
> LastWrite
> and LastModified filters, but they don't seem to completely solve the
> problem. Finally, there is the documented issue of multiple events being
> fired from one event, but I think I can work around this issue if I can
> get
> the rest working properly. The FileSystemWatcher really looks like a
> useful
> tool, but only if it works correctly. Any help on this issue is greatly
> appreciated. Thanks.



Relevant Pages

  • Re: uscita video ibook e HDTV
    ... > Avevo capito:) Sono costretto a ripetermi: puoi impostare risoluzioni ... > separate per le due uscite video solo se usi i due monitor come due ... Se vuoi duplicare l'immagine che vedi sul monitor ...
    (it.comp.macintosh)
  • Re: one machine - multiple users, monitors, keyboards, mice ...
    ... > monitors, two keyboards, and two mice, and run a display manager like ... > I'd get the second monitor and keyboard on that particular host. ... that you apply a patch to, to be able to separate keyboard inputs. ... With 2 Nvidia cards you have to use the Nvidia closed-source ...
    (Debian-User)
  • Re: doing schoolwork while using the tv for mce
    ... You can configure your second monitor as a separate monitor using ... the advanced properties of your video adapter (which adapter do you have, ... there are still problems...the Media Center app must run ...
    (microsoft.public.windows.mediacenter)
  • Daul monitor
    ... I have a Sun Ultra 10 m/c with Solaris 8. ... I want to connect two monitor with that m/c simultaenously & run two separate application on separate monitor. ...
    (SunManagers)
  • Re: FileSystemWatcher onCreated tell where it was created from?
    ... What do u need is to monitor harddrivers for changes, ... B> acceptable) this the FileSystemWatcher does not do (straightforwardly ... public static void Main ... RenamedEventArgs e) ...
    (microsoft.public.dotnet.framework)