Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

directory change detector on windows twapi maybe?

36 views
Skip to first unread message

tedbr...@gmail.com

unread,
Aug 25, 2019, 12:46:23 PM8/25/19
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
}

greg

unread,
Aug 25, 2019, 3:54:17 PM8/25/19
to

greg

unread,
Aug 25, 2019, 4:22:10 PM8/25/19
to

tedbr...@gmail.com

unread,
Aug 25, 2019, 4:35:21 PM8/25/19
to
On Sunday, August 25, 2019 at 1:22:10 PM UTC-7, greg wrote:

> An example can be found at
> https://twapi.magicsplat.com/v1.1/examples.html

Wow, exactly what I was looking for, thanks so much!
0 new messages