LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show all open file references

Is there any way to show all open file references?  I would like to be able to see what VIs are holding open file references at any particular time and what those references point to.  My code opens and closes many (Many, many) files and every once in awhile, I fail to close a file reference when I should and it holds up the file system.  Trying to track down exactly where and when is proving to be extremely hard to do globally.

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

Hi xl600,

 

Check out this link if you haven't already for information about closing references in LabVIEW. Unfortunately, to my knowledge, there is not a way to view all open file references (this makes sense, for security reasons).

 

If you simply want an easier way to track down open references, I would recommend writing a VI script that searches for all of the opened references in your application using the VI server. From here, you can compare that list against all of the references you are closing and hopefully it will help you track down your error. The exact problem you are describing is the reason you should be very careful with your open reference calls, as they are difficult to track after development.

 

Best,

 

Duncan W.

0 Kudos
Message 2 of 4
(3,642 Views)

It turns out its not my code 🙂  I use the .net filesystemwatcher to send events back to my VIs when things on disk change and it's the watchers that are holding things open even though I explicitly close those.  I guess the .net GC isn't cleaning up or CAR 468139 's workaround doesn't actually work.

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

You can get opened file references of LVRT process using this command:

lsof -p $(pidof ./lvrt)

 Might be helpful.

0 Kudos
Message 4 of 4
(2,504 Views)