Walk a directory/Recursively: Difference between revisions
Content added Content deleted
m (moved Walk Directory Tree to Walk a directory/Recursively) |
(Added PicoLisp) |
||
Line 519: | Line 519: | ||
This implementation uses Perl compatible regular expressions to match the whole path of the file |
This implementation uses Perl compatible regular expressions to match the whole path of the file |
||
=={{header|PicoLisp}}== |
|||
<lang PicoLisp>(let Dir "." |
|||
(recur (Dir) |
|||
(for F (dir Dir) |
|||
(let Path (pack Dir "/" F) |
|||
(cond |
|||
((=T (car (info Path))) # Is a subdirectory? |
|||
(recurse Path) ) # Yes: Recurse |
|||
((match '`(chop "s@.l") (chop F)) # Matches 's*.l'? |
|||
(println Path) ) ) ) ) ) ) # Yes: Print it</lang> |
|||
Output: |
|||
<pre>"./src64/sym.l" |
|||
"./src64/subr.l" |
|||
...</pre> |
|||
=={{header|Pop11}}== |
=={{header|Pop11}}== |