Walk a directory/Recursively: Difference between revisions
Content added Content deleted
No edit summary |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 1,329: | Line 1,329: | ||
/Users/xxx/music/albumx/trackx2.mp3 |
/Users/xxx/music/albumx/trackx2.mp3 |
||
/Users/xxx/music/albumy/tracky.mp3 ...</pre> |
/Users/xxx/music/albumy/tracky.mp3 ...</pre> |
||
=={{header|Lua}}== |
=={{header|Lua}}== |
||
Lua provides functions such as os.execute([command]) and io.popen(prog [, mode]). Below an example for Windows users having io.popen at their disposal. Mind you, it may pop-up a command window. |
Lua provides functions such as os.execute([command]) and io.popen(prog [, mode]). Below an example for Windows users having io.popen at their disposal. Mind you, it may pop-up a command window. |
||
Line 1,600: | Line 1,601: | ||
find_files('.', '*.mp3');</lang> |
find_files('.', '*.mp3');</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | Or if you value performance over portability, here's a function that runs the GNU <tt>find</tt> 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. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 1,872: | Line 1,847: | ||
... *.rkt files including in nested directories ... |
... *.rkt files including in nested directories ... |
||
</lang> |
</lang> |
||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | Or if you value performance over portability, here's a function that runs the GNU <tt>find</tt> 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. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Rascal}}== |
=={{header|Rascal}}== |