Overview
This example highlights how to dynamically and programmatically create a file and open a reference to it, when both the file and the directory structure need to be created.
Description
Without creating non-existent folders in the specified file path, an "Error 7" error is caused by the "Open/Create/Replace File" vi. This example shows how to prevent this error from happening.
"Create Folder vi" is used to create the missing folders, only if they don't already exist. The "Create Folder vi" causes an error if the specified file path already exists, so if it does already exist, we don't want to call the "Create Folder vi". To accomplish this the "Check if file or folder exists vi” is used to control the case structure with the "Create Folder vi" inside.
Requirements
- LabVIEW 2012 Base Development System (or compatible)
Steps to Implement or Execute Code
- Download the VI “Dynamically Create Directory 2012 NIVerified.vi”
- Run the program
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Systems Engineer
SISU