LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in Open/Create/Replace File

Solved!
Go to solution

I found this problem in LabVIEW 2009. The boolean indicator doesn't seem to work properly in the first snippet. It returns TRUE even with a valid path. With some trial and error I found a workaround that will make it work properly for now. I just wire an Error Out after the Open/Create/Replace File (second snippet). Is this a bug?? Am I doing something wrong?? 

 

I've got a lot of code that uses this to test to check for existing files and then wire the output to a case statement. I also know there is a Check if File/Folder Exists.vi available. I would hate to spend a lot of time changing all my code if this is a known bug and it will be fixed in the next update. If it is not a know bug, where can I submit this??

 

 

Open File (Not_Refnum Bug).png

 

Open File (Bug Fixed).png

0 Kudos
Message 1 of 3
(2,997 Views)
Solution
Accepted by topic author jamiva

Its not a bug. You have race condition between indicator and close ref.

 

Use it in this way:

 

NotAPath.png

 

Andrey.

Message 2 of 3
(2,988 Views)
I learn something new each day. I have been doing it this way for quite some time. I'm surprised that I haven't seen this race condition before. Thanks!
0 Kudos
Message 3 of 3
(2,966 Views)