To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI will count ALL files in a specified folder and all sub-folders recursively.
Description
This VI makes use of recursion. A recursive VI must be reentrant (see LabVIEW help on reentrant). The VI creates a reference to itself and then calls Open VI Reference to open a new VI of itself. The new VI is passed with the subfolder of the parent folder and process is repeated for the subfolder (as if it were the parent folder).
Once all subfolders are traversed the sum of the subfolders count and the parent folders are added together to give a final count.
Beware of using this program on a large system directory. A new VI will be spawned fo reach subfolder in your folder tree and this could cause memory errors.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet of Block Diagram
**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.