Directory Nodes

john's Avatar


26 Nov, 2017 06:58 AM

The attached zip file contains a folder and demo file with two custom nodes: list_files and list_folders.

Both nodes require a folder path (starting from your desktop). list_files will return a list of files within that folder; list_folders returns a list of subfolders within that folder.

These nodes work nicely with import_text and import_csv to perform batch operations across multiple files. The demo file shows two simple use cases. In the first example, list_files retrieves all three files in the Directory Nodes folder (assuming you placed it on your desktop), takes the first one, and uses import_text to show its contents.

The second example shows how you can combine list_folders and list_files to retrieve a list of all the files in all the subfolders of a given folder. Note that these nodes return only the top level files or folders. Since NodeBox does not do recursion you cannot do a full recursive search of a directory tree with these nodes. (It wouldn't be too hard to modify the Python nodes to do this though).

To use these nodes in your own network you will need to include the two python files ( and and add them to the Code Library of your network.



Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • Directory_Nodes_Screenshot.png 308 KB
  • 6.32 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

16 Jun, 2022 05:30 AM
15 Jun, 2022 06:03 AM
06 Jun, 2022 01:07 PM
02 Jun, 2022 11:58 PM
30 May, 2022 07:48 AM


24 May, 2022 06:27 PM
20 May, 2022 04:12 PM
05 May, 2022 02:25 AM
03 May, 2022 04:46 AM
01 May, 2022 09:22 AM
18 Apr, 2022 09:01 PM