Recursively
Using the File::Find module:
Alternatively, a custom solution that provides the same interface as the built-in (non-recursive) dir
function, and uses gather
/take
to return a lazy sequence:
Or if you value performance over portability, here's a function that runs the GNU find
program and returns a lazy sequence of the files it finds. Parameters are not subjected to shell expansion, and the null-byte (which cannot be present in file paths) is used as the path delimiter, so it should be pretty safe.
Last updated