From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 04/03/2006

Have you ever written a VI to recurse the contents of a folder?  Or have you tried to find somebody else who wrote that VI so you could copy it?  There is actually a VI that ships with LabVIEW that can do this for you.  Check out vi.lib\utility\libraryn.llb\Recursive File List.vi (available in LabVIEW 7.0 and later).  Give it a path to a folder or LLB, and it will return a recursive list of all files that exist in that folder/LLB.  If you specify a folder, the VI also returns a list of all the subfolder names.  There is also an input to this VI that allows you to treat LLBs as folders so you can recurse their contents as well.  There currently is not a way to specify a pattern (like *.vi) to filter the list, but there will be a pattern input in a future LabVIEW version.

-D

P.S. - Check out past nuggets here.

Message 1 of 11
(10,873 Views)
Good tip, Darren. I've seen several developers spend a lot of time trying to create a similar functionality from scratch. The fact that you both get all files and all folders just makes this VI GREAT!

Here's a screenshot of the Context Help for the VI:


Message Edited by Philip C. on 04-05-2006 09:26 AM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 2 of 11
(10,772 Views)


@Philip C. wrote:
I've seen several developers spend a lot of time trying to create a similar functionality from scratch.



Yes... I'm one of them... 😮

Thanks Darren.  😄

Keep those nuggets' coming! 

Message 3 of 11
(10,767 Views)
Cool,

But how does the block diagram look.....?

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 4 of 11
(10,755 Views)

"But how does the block diagram look.....?"

"Pay no attention to the man behind the curtain." (Wizard, Wizard of Oz)

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 11
(10,744 Views)

Well, I was about to tell you to check it out for yourself, but then I realized you have LabVIEW 6.1.  No matter, here's a copy saved just for you in LabVIEW 6.1 format.

-D

Message 6 of 11
(10,744 Views)
The OpenG libraries also have a "List Directory Recursive" function. It also works with LLBs.
Message 7 of 11
(10,740 Views)
Thanks Darren,

I was originally only interested if the way I wrote my version (We all have done this at one time or another, right?) was in any way similar or not.

Now that I have code, I can actually use it >rubs hands with glee<

Thanks.

Shane.

Edit: Aw, that's kind of depressing.  It's so much simpler than what I cooked up.  Looks nice and simple, why didn't I think of that?

Message Edited by shoneill on 04-05-2006 05:52 PM

Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 8 of 11
(10,738 Views)

I'm all about the simple solution.  🙂

-D

Message 9 of 11
(10,725 Views)


@Darren wrote:

I'm all about the simple solution.  :)


Does that mean you wrote it?

BTW, speaking of OpenG, it also "exposes" the librarian VIs in a palette.


___________________
Try to take over the world!
Message 10 of 11
(10,692 Views)