tedbr...@gmail.com
unread,Aug 25, 2019, 12:46:23 PM8/25/19You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Does tcl have a way to be notified when a directory changes. I need this for a windows system.
I know twapi can call low level windows functions and there's a way in windows to detect changes, but the low level twapi interface is not documented and I can't find a higher level twapi interface for this. Here's what I found on doing it from c++ or c# (I don't know which language this is)
// Declare a new FILESYSTEMWATCHER
protected FileSystemWatcher watcher;
string pathToFolder = @"YourDesired Path Here";
// Initialize the New FILESYSTEMWATCHER
watcher = new FileSystemWatcher {Path = pathToFolder, IncludeSubdirectories = true, Filter = "*.*"};
watcher.EnableRaisingEvents = true;
watcher.Created += new FileSystemEventHandler(WatcherCreated);
void WatcherCreated(object source , FileSystemEventArgs e)
{
//Code goes here for when a new file is detected
}