How to create a folder that listens to changed files or new files

I have a requirement when I create a lot of swc files (swc files are like zip or jar files). I want that whenever I create a new swc file and add it to a "specific folder", those files should be automatically extracted (similar to what happens in the Apache Tomcat web folders folder). Please help me how to do this on Windows. [Note: I know I can write an ant / rake / gradle script that can do this for me, but just to learn more on Windows how to do it]

+1


source to share


6 answers


Use the FileSystemWatcher class if you are using .NET. ( here )



+3


source


If you are not using .NET, you can use the FindFirstChangeNotification function to listen for file system changes.



+2


source


If you want to do this in a scripting style, you will use the WMI Event Watcher. http://technet.microsoft.com/en-us/library/ms141130.aspx

+1


source


you can use .NET FileSystemWatcher to accomplish this task. (using C #, vb.net, etc.) with FileSystemWatcher you can watch and react to file creation, deletion and modification.

0


source


FileSystemWatcher is the obvious choice in .Net.

IMHO this is not a very good component. Many times it raises double events for file change and I was unable to do a neat implementation with FileSystemWatcher.

0


source


Don't use .NET (for kids) Use Win32 api notifications (8 lines of code)

-1


source







All Articles