LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
PalanivelThiruvenkadam

Create Folder with Create if not found option

When developing a Complex LabVIEW Applications, we may need to create N Number of Folders as a part of Configuration information.

This requires the developer to make a check "Check if File or Folder Exists"

Instead of that Create Folder Function can have a Boolean "Optional Input" to create the Folder only if not found in the specified Location and Eliminating the Error when trying to create same folder again.

Hope this will help Smiley Happy

----------------------------------------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------------------------------------
8 Comments
wiebe@CARYA
Knight of NI

You need to make that yourself. Use File Info to check if the directory is there, and if so(use a case structure) skip the creation.

PalanivelThiruvenkadam
Active Participant

Yes i do understand that there is a way which i have mentioned in the description, But still then this will make the developers work ease, also when creating a N Number of Folders with Different Folder Structure this will reduce using this Check N Number of Times.

 

Everything will be good if a particular application needs minimal or single path creation/ Folders are in Absolute path. when the case is different we need to find an easy way that what we all trying to do.

----------------------------------------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------------------------------------
wiebe@CARYA
Knight of NI

I think I just don't get the problem then.

Mads
Active Participant

There are several good solutions to this in the public domain.

 

The most popular is probably the OpenG function called Create Dir if Non-Existant. There is also one called Create Directory Recursive in the NI String library.

 

You can install OpenG with the VI Package Manager, or find it here on the LabVIEW Tools Network.

 

 

 

 

 

crossrulz
Knight of NI

Duplicate: Open/Create/Replace File Function - create file's path if it does not exist


GCentral
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
crossrulz
Knight of NI

And just to finish the thoughts...

I just go ahead and try to create the folder and then use Clear Errors set to only ignore error code 10 (Duplicate File, which is the error you get when you try to create a directory that is already there).  No need to do the check first.


GCentral
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
Darren
Proven Zealot
PalanivelThiruvenkadam
Active Participant

Thank you all for your comments.

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Open-Create-Replace-File-Function-create-file-s-path-...

this seemed to be for creating File Path creation which also includes folder options.

 So i thought if create Folder has an option of Boolean to create if not created as same as Queues which will create if not found.

But Still if it doesn't adds value we can go with other options for the same problem.

----------------------------------------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------------------------------------