LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

No path or empty path can exist?

Hello!

There is this LV internal VI to check if a file/folder exists, which would return a boolean. When opening the front panel, the path box is empty. When running the VI, see below, it would return TRUE, meaning the not given path exists. That makes me wonder what the definition of the existence of a file or folder is...😮

 

MaSta_1-1678203558328.png

 

 

 

 

 

0 Kudos
Message 1 of 15
(2,113 Views)

The empty path is in LabVIEW indeed a valid path for some functions. 

It is in fact the root to all paths. Under Windows this is the (virtual) path in which all the drives are located. Under Unix this is the root path itself "/".

 

If you use for instance List Folders with an empty path as input you get under Windows all the valid drive letters, and under Unix all the top level directories. Under Mac with HFS you got all the Volumes on the desktop but HFS is not used anymore in LabVIEW for Mac since the demise of the 32-bit version of this with LabVIEW 2017. The 64-bit version of LabVIEW for Mac always used Posix style paths, just as the Linux version.

 

So in summary the Empty Path definitely is a valid path in LabVIEW as it is the root of the file system/desktop.

Rolf Kalbermatter
My Blog
Message 2 of 15
(2,111 Views)

For future reference, you can also find this info in the help file.  And if you think rolfk copied that response from the help file, you would be wrong.  In fact, quite the opposite.  The help file was written based on information in rolfk's brain. 

aputman_0-1678217702924.png

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 3 of 15
(2,069 Views)

OK, but you would want to use the VI to find out if a file or folder exists, and no path given is not an existing folder, no matter how LV interpret an empty path. At least in this case the LED shouldn't light up. I will modify the VI now. 

0 Kudos
Message 4 of 15
(2,022 Views)

@MaSta wrote:

OK, but you would want to use the VI to find out if a file or folder exists, and no path given is not an existing folder, no matter how LV interpret an empty path. At least in this case the LED shouldn't light up. I will modify the VI now. 


I don't understand this statement.  Wouldn't you just use billko_0-1678284533503.png ?

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 15
(2,000 Views)

If you don't want to allow empty paths, just do a check for them using the comparison function "Is Path and Not Empty?"  The underlying code for the "Check if File/Folder Exists" can't be modified.  That is the "File/Directory Info".  So now you will have one function that returns false and another function that returns true for the same request.  Makes zero sense but you're certainly allowed to do stupid things. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 15
(1,991 Views)