2.7 KiB
2.7 KiB
Get File Count - Count files in a folder
Node Purpose: Get File Count scans a folder and returns the number of image, video, PSD, or text files found, plus list-form filename and file_path outputs. filename can be configured to keep or strip the extension. It supports recursive scanning, stable sorting, and a change hash suitable for caching.
Inputs
| Name | Port | Type | Default | Range | Description |
|---|---|---|---|---|---|
folder |
- | STRING | "" |
- | Target folder path. |
type |
- | COMBO | image |
image / video / psd / txt |
File type group to count. |
filename_suffix |
- | BOOLEAN | false |
- | Controls whether filename keeps the extension; when disabled, only the stem is returned, and when enabled the suffix is preserved. |
include_subdir |
- | BOOLEAN | true |
- | Include subfolders in the scan. |
Outputs
| Name | Type | Description |
|---|---|---|
count |
INT | Number of matched files. |
folder |
STRING | Echo of the input folder. |
filename |
STRING LIST | List of matched file names, one item per file. |
file_path |
STRING LIST | List of matched file paths, one item per file. |
include_subdir |
BOOLEAN | Echo of the input option. |
Features
- Extension filtering: counts common image, video, PSD, or text extensions.
- Deterministic order: paths are sorted case-insensitively for consistent results.
- Filename output: exposes the sorted match list as a
filenamestring list, with configurable extension keep/strip behavior. - Path output: exposes the sorted match list as a
file_pathstring list for precise downstream file access. - Change tracking: a path-list hash is used to support efficient downstream caching.
Typical Usage
- Count frames as files before batch loading images or videos from a directory.
- Scan a PSD asset folder, then pass
filenamedirectly into downstream nodes that accept string lists without an extraList Custom Stringstep. - When you need clean asset names without suffixes, keep
filename_suffix=falseto get stem-only multiline output. - When downstream logic needs exact file locations, use
file_pathinstead of reconstructing paths fromfolderandfilename.
Notes & Tips
- When
folderpoints to an empty or unmatched directory,countbecomes0. filenamereturns base file names only; when recursive scanning is enabled, duplicate names from different subfolders will appear as repeated list items.- When
filename_suffix=false, only the last extension is removed, soa.test.psdbecomesa.test. file_pathreturns the matched path list and preserves subfolder information during recursive scans.