Last active
May 26, 2020 09:23
-
-
Save Igaryu/d4ba61d8c0a1cbeceba46562c9c028cf to your computer and use it in GitHub Desktop.
Walks thru a dir and its subdirectories in Livecode Language.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recurDir dir, ext | |
set the defaultFolder to dir | |
repeat for each line fi in the files | |
if fileExt(fi) = ext then | |
put the longfilepath of fi & cr after fileList | |
end if | |
end repeat | |
repeat for each line di in the folders | |
if di is not "." and di is not ".." then | |
put recurDir((dir & slash & di), ext) & cr after fileList | |
end if | |
end repeat | |
filter fileList without empty | |
return fileList | |
end recurDir | |
function fileExt f | |
set the itemdel to "." | |
return the last item of f | |
end fileExt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Livecode RECURSIVE directory scanning.
So the path passed as argument plus all sub direcotries.