Trigger process when a file arrives

  • Thread starter Thread starter JohnSouth
  • Start date Start date
J

JohnSouth

Hi

I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.

I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?

I'd appreciate any suggestions.

John South
www.WhereCanweGo.com
Pangbourne UIK
 
What kind of performance do u need and why recomended FileSystemWatcher isn't
suitable for you?
I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.
I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
John,

As others have pointed out, you should use the FileSystemWatcher class.
Running a service is not inefficient, really. If anything, you can run the
service and then have your FileSystemWatcher instance wait for events from
the file system.

Also, you might want to check out BizTalk, as it has an adapter for
watching a directory for files.

Hope this helps.
 
Back
Top