LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"File or Folder exists" VI returns TRUE if the path is EMPTY

Another one for the R&D suggestion box:
Under Advanced File Functions in Labview 8.2 is a "new" VI, "Check if File or Folder Exists?". Give it a valid path and it will give you back a TRUE/FALSE as appropriate, give it an EMPTY path and it will give you a TRUE! Turns out, one of its SUB-VI's is the good old "File/Directory Info" VI who gladly returns NO ERROR if the path it is given is empty. And since there is only a check for NaP but not empty path as well, the VI outputs a TRUE.

Just a head's up.
0 Kudos
Message 1 of 5
(5,195 Views)
Empty path should return TRUE, non-exist path return FALSE.
 
Do I misunderstand your post?
 
 
George Zou
 
George Zou
0 Kudos
Message 2 of 5
(5,171 Views)

This is expected behavior...an empty path (in LabVIEW, anyway) refers to the "root" folder...on Windows, this would be "My Computer".  Try it out with the List Folder function...give it an empty path, and it will return to you all the drive letters on your machine (A:, C:, D:, etc.).  So the VI is functioning correctly, because it is in fact TRUE that My Computer exists... 🙂

The correct behavior is even more apparent on Linux, because an empty path on Linux is actually the root "/", which will return all folders under root on the machine.

-D

Message Edited by Darren on 10-26-2006 10:00 AM

0 Kudos
Message 3 of 5
(5,166 Views)
There is a Window API - PathFileExists can give you correct answer.  It's simpler, and faster.
 
 
 
George Zou
George Zou
Message 4 of 5
(5,160 Views)
Hmmm..I didn't think about that, makes sense I guess.
 
Thanks.
0 Kudos
Message 5 of 5
(5,140 Views)