10-22-2018 09:08 AM
Hello,
Here is my problem : I try to monitor a folder and when a new file is created, i want to know it.
I ckecked so many discussion and I saw "FileSystemWatcher" which seems to work with Labview.
So, is it possible to do the same thing with Labwindows/CVI 2017 ?
Thank you in advance.
Solved! Go to Solution.
10-22-2018 09:20 AM - edited 10-22-2018 09:23 AM
I published a slightly different program sample that monitors changes to a single file in a folder relying on a system notification. You can look at it as a starting framework to develop your own function. My example can be found here.
NOTE It's been a while since I've developed this example and I see no note on the page so I may be wrong, but I seem to remember that this mechanism fails when trying to monitor a file on a remote folder
10-22-2018 09:30 AM
Thank you for your program.
But the problem is to check any new file, not just one.
10-22-2018 06:13 PM - edited 10-22-2018 06:19 PM
As you may find by reading it, my code relies on FindFirstChangeNotification Windows API, which monitors for every change in the target folder; limiting the inspection to a single file is a supplementary operation performed after the event is received by the thread. Passing FILE_NOTIFY_CHANGE_FILE_NAME to the function as the filter condition will trigger the notification even for file creation.
After receiving the event, you may want to refine the and filter the events by using ReadDirectoryChangesW function, which is a bit more complex to use than the former one and I didn't tried to implement in CVI.
02-14-2022 03:08 AM
Hi,
Can we monitor continously any folder for new files, using teststand alone?