ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Path Validation

Hi all,

 

How do I check if a file path is valid or not.By valid I mean that a path may be a valid path on one system but is incorrect on other systems.This case arises because we enter file paths in configuration files.And many a times we copy and use the configuration files in other systems forgetting to enter a valid path for that system.

 

Any kind of help is highly appreciated.

Thanks in advance.

 

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

File IO ->Advanced File Functions->Check If File Or Folder Exists.vi



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(3,081 Views)

As Mentioned by CrossRulz

 

Use "File IO ->Advanced File Functions->Check If File Or Folder Exists.vi"

Along with this use check for Empty File Path, Since Even Empty File Path Will give true for File or Folder Exists.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 4
(3,068 Views)

To help with portability, save your paths as binary data rather than converting them to strings and saving the strings.  When you convert a path to a string, the OS-specific path element delimiter gets embedded in the string.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 4
(3,052 Views)