To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example allows your code to automatically detect if a specified file or folder already exists.
Description
This simple little SubVI allows your code to automatically detect if a specified file or folder already exists - and if it does exist the algorithm adds an incrimentally increasing interger to the end of the filefolder path, until it is unique - thereby, preventing you overwriting any files/folders.
Requirements
Steps to Implement or Execute Code
1. Run the VI once - it will create a Folder called Test Sub Folder in the Application Directory, and the Path Modifed? LED will be off.
2. Run the VI subsequent times, and the VI will detect that the Test Sub Folder already exsists, and will create a Test Sub Folder1, Test Sub Folder2, Test Sub Folder3 instead. The Path Modifed LED will be on.
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This VI will not incremant in sequence with last increment. ie if test sub folder 2 selected next should be
test sub folder 3 and not test sub folder 21