LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event From Directory Change

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

0 Kudos
Message 1 of 4
(3,138 Views)

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,

V-F
0 Kudos
Message 2 of 4
(3,129 Views)

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

 

0 Kudos
Message 3 of 4
(3,122 Views)

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?

0 Kudos
Message 4 of 4
(3,026 Views)