LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the folder or the files exist in the path

Hi i have to check the folder and the file in the folder is was created or not. For example c:\Abc\123.txt..i want to make sure that there is folder cal Abc and if dont have i need to create tht folder and have to create 123.txt. How to create folder and txt when it not exist? help plz.
0 Kudos
Message 1 of 4
(2,867 Views)

The OpenG toolkit has a function 'Create dir if non-existent', you feed this function the folder (c:\abc) and the folder will exist after this piece of code.

Then you can use the native read/write functions to create or open the file.

 

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 4
(2,865 Views)
Goto Advanced File Functions in the File I/O palette. There are function nodes List Folders and Create Folders. Also, in the File I/O palette, there is a function Open/Create File. Check them out and post back if you have any questions.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 4
(2,864 Views)

There's also a VI that ships with LabVIEW that does this:

 

vi.lib\utility\libraryn.llb\Create Directory Recursive.vi

0 Kudos
Message 4 of 4
(2,825 Views)