471,353 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Trigger process when a file arrives

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

Feb 15 '06 #1
4 1648
Try the FileSystemWatcher class.

"JohnSouth" <Jo**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
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

Feb 15 '06 #2
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
Feb 15 '06 #3
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"JohnSouth" <Jo**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
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

Feb 15 '06 #4
Thanks All
That's just what I need.

John South
www.WhereCanweGo.com
Pangbourne UK

Feb 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Terri | last post: by
9 posts views Thread by Lauren Quantrell | last post: by
9 posts views Thread by Martin | last post: by
33 posts views Thread by coosa | last post: by

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.