Code Snippets

Tag: Recursion

Find Files Recursively

find with -type f, size filter, and -exec for batch action.

Author: chris

Walk a Directory Tree

Use os.walk to enumerate every file under a path.

Author: chris

Recursive Directory Iterator in PHP

Walk a tree with RecursiveDirectoryIterator + RecursiveIteratorIterator.

Author: chris

Iterate a Directory in Rust

Walk a single directory level with std::fs::read_dir.

Author: chris

Recursive Glob in Ruby

Find every `.rb` file under a tree with Dir.glob and `**` recursion.

Author: chris