04-14-2009 09:18 AM
I need to take some action as soon as a file has been changed.
I donot want to polling the file content all the time. Can I check the modified time property of the file.
May I know how to do it. Thanks.
Solved! Go to Solution.
04-14-2009 10:01 AM
If you don't want to do polling then you need to use a callback. How you do this depends on which operating system you're running, which is.... ???
For example, on Windows, you can try to use the Windows API, like FindFirstChangeNotification (good luck with that). Alternatively, you can use the .NET FileSystemWatcher class. Examples ship with LabVIEW to show you how to do callbacks for .NET. Something like this:
02-17-2012 08:58 AM
Hello everyone!
I've followed the example and it works fine. I want to use this solution to manage a data file when this new file is created in a directory that my application is "watching". So, how can I retrieve the file name using this solution?
Greetings!
02-17-2012 11:38 AM
You need to look at the documentation for the FileSystemWatcher class. If you set the "filter" to an empty string, then it will watch for any changes to the directory, rather than to a specific file in that directory. The Changed event will return the name of the file that was changed.
02-23-2012 08:12 AM
Finally, I get the answer. Using a Property Node connected to the VI Server Reference, as you can see in the image.
s.
Greetings!