Skip to content

Instantly share code, notes, and snippets.

@Igaryu
Last active May 26, 2020 09:23
Show Gist options
  • Save Igaryu/d4ba61d8c0a1cbeceba46562c9c028cf to your computer and use it in GitHub Desktop.
Save Igaryu/d4ba61d8c0a1cbeceba46562c9c028cf to your computer and use it in GitHub Desktop.
Walks thru a dir and its subdirectories in Livecode Language.
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
@Igaryu
Copy link
Author

Igaryu commented May 26, 2020

Livecode RECURSIVE directory scanning.
So the path passed as argument plus all sub direcotries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment