Programmatically Search for or Create a Directory in LabVIEW

Updated Aug 18, 2023

Reported In

Software

  • LabVIEW Full
  • LabVIEW

Other

File I/O palette

Issue Details

  • How do I programmatically search for or create a new directory in LabVIEW?
  • How can I programmatically check if a folder exists in LabVIEW?

Solution

To search for a directory, use the List Folder VI. This VI is located in the Functions Palette at Programming»File I/O»Advanced File Functions. Wire a Base Path as one of the inputs of the function. This function returns all the files and directories in the base path directory. If you are looking for a particular directory , you can wire the name of that directory to the Pattern input of the List Folder function. Now, search the Folder Names array output to see if it contains the directory name that you are looking for. 

If you would like to create a new directory, use the Create Folder VI. This VI is also located in the Functions Palette at Programming»File I/O»Advanced File Functions.