I have a requirement where I create many swc files (swc files are similar to zip or jar files). I want that, whenever I create a new swc file and add it in a "particular folder" then these files should automatically get extracted (similar to what happens in Apache Tomcat webapps folder). Please help me how to do that in Windows. [Note: I know I can write a ant/rake/gradle script which can do this for me, but just to explore more in Windows how to achieve this]
A:
you could use the .NET FileSystemWatcher to do this task. (from withing c#, vb.net, etc..) with FileSystemWatcher you can observer creation, deletion and modification of files and react to those events.
Joachim Kerschbaumer
2008-12-09 17:58:38
+1
A:
If you want to do it in a windows scripted fashion, you would use a WMI Event Watcher. http://technet.microsoft.com/en-us/library/ms141130.aspx
EBGreen
2008-12-09 18:01:35
.Net is for kids? You obviously need to wring your brain out: it's full of dirty water.
Jonathan C Dickinson
2009-03-19 05:31:34
Btw, it is 0 lines of code in .Net if you use the Forms designer.
Jonathan C Dickinson
2009-03-19 05:32:24
+2
A:
If you are not using .NET, then you can use the FindFirstChangeNotification function to listen for filesystem changes.
Greg Hewgill
2008-12-09 18:07:53
A:
FileSystemWatcher is the obvious choice in .Net.
IMHO, its not a good component. Many a times it raises double events for change of files and I have not been able to do a neat implementation using FileSystemWatcher.
nils_gate
2009-03-19 04:46:43