Arian Kulp's Blog
opinion, insight, and occasional code

Newest article posted

Sunday, October 16, 2005 12:43 AM

My newest article has been posted on MSDN Coding 4 Fun!  I wrote a little utility to watch a specified folder for new files.  When files appear, you can have them automatically moved to a different folder based on extension.  This would let you setup an incoming folder, perhaps for an HTTP file uploader, then have all images moved to one folder, all Microsoft Word documents moved to another folder, etc.  It's a neat little thing that runs in the system tray.  I think it offers some good opportunities to add onto it (it's admittedly pretty basic now...), but it offers value “out of the box“ as well.  Take a look at:

http://msdn.microsoft.com/coding4fun/inthebox/filerouter/default.aspx

Enjoy!




Feedback

# re: Newest article posted

Hello,
just read your article.... I have only one thing to add : FileSystemWatcher is ok for small folders...
when too many files arrives in the folder listened, the event is not called for everyfiles !! give a try with 500 files (a cut/paste from another folder, a batch program generating many files at once....) and it is going to miss some files....
the only way to do the process is to have a timer scanning the folder every xx seconds ;)
anyway this is a nice article :)
see ya,
DarkAngel (sorry for my english, I'm french :p) 11/17/2005 10:26 AM | DarkAngel

# re: Newest article posted

You're absolutely right. You can increase the buffer for notifications, but there is no sure-fire way of getting every notification. Setting filters can help, but again, no guarantee. Using the FileSystemWatcher object is a much easier way for a teaching app though! Perhaps (if it doesn't exist already), it would be good to create a nice reusable component to do this. It could extend the FileSystemWatcher I think. That would cut down on directory scanning. If any event is fired, do a manual scan to catch every change. This could be modified to work better for arbitrary network shares too. Thanks for the feedback!

As for your English, just keep up with it! You have a great grasp of it already. I'm slowly learning Spanish. You speak English much better than I speak Spanish! 11/18/2005 9:40 AM | Arian



Comments have been closed on this topic.