A
Allen Anderson
I'm trying to figure out a way to catch when a file has been written
to a directory. I currently have it where I can catch when the file
begins writing, but this isn't helpful as I need to know when its
done. Does anyone know the right combination of flags to use to catch
when the file has been written and closed? (here is my current code).
// member variable
FileSystemWatcher watcher = new FileSystemWatcher();
// init code
watcher.Path = @"c:\testwatchdir";
watcher.NotifyFilter = NotifyFilters.FileName;
watcher.Filter = @"*.xml";
watcher.Created += new FileSystemEventHandler(watcher_Created);
watcher.EnableRaisingEvents = true;
to a directory. I currently have it where I can catch when the file
begins writing, but this isn't helpful as I need to know when its
done. Does anyone know the right combination of flags to use to catch
when the file has been written and closed? (here is my current code).
// member variable
FileSystemWatcher watcher = new FileSystemWatcher();
// init code
watcher.Path = @"c:\testwatchdir";
watcher.NotifyFilter = NotifyFilters.FileName;
watcher.Filter = @"*.xml";
watcher.Created += new FileSystemEventHandler(watcher_Created);
watcher.EnableRaisingEvents = true;