11-14-2012 12:43 AM
Is there a way I can get an event from a directory change? I've looked into FileSystemWatcher but from what I could gather, that would only notify my of a change within a directory. I wanted something that tells me exactly what changed. i.e. if a new file was added, changed, renamed etc. Instead of throwing a general event, where I would than have to compare the changes to the previous state, i.e. file names within the directory, file sizes etc. Basically it would save alot of post processing work. Since I haven't seen anything of this nature in the forums, it might not be posible, but I thought I'll ask just incase.
Thanks
Kas
11-14-2012 03:43 AM
Hi,
the Filesystemwatcher can generate distinct event.
This configuration will make a signe event and will make no difference between a new file and a saved file.
But if you create one event per modification, you can call specific code according to the modification.
The problem you could have could be with the amount of watched files and their sizes : you will have to make a buffer to compare previous file and new file, so if you have large files, this will take a lot of time to compare them...
Best Regards,
11-14-2012 05:56 AM
Be advised that individual applications can generate multiple FileSystemWatcher events for what you as a consumer would treat as a single event.
Something as simple as saving a file in notepad can generate 7 or 8 events.
The link below is not LabVIEW related, but does point out how FileSystemWatcher works...
http://www.codeproject.com/Articles/58741/FileSystemWatcher-Pure-Chaos-Part-2-of-2
04-30-2014 12:16 PM
Any ideas on how to do this on a real-time target? As far as I know they don't support .NET? Would I just have to create a VI that polls the dir contents with some frequency and compares the results for differences?