I have a simple application using Windows-based FileSystemWatcher. Files are saved in a directory through an Excel VB macro using
ActiveWorkbook.SaveAs Filename:= "pathToSaveTo"
When creating a new file, the observer calls the file processing method.
void watcher_FileCreated(object sender, FileSystemEventArgs e)
{
while (true)
{
if (FileUploadComplete(e.FullPath))
{
this.ProcessOneFile(e.FullPath, e.Name);
break;
}
}
}
An observer application never logs an event when it occurs, but manually deleting and re-adding files to a folder raises an event.
Does anyone know how I can get the expected behavior when saving a file in a directory?
source
share