RosettaCodeData/Task/Walk-a-directory-Recursively/LiveCode/walk-a-directory-recursively-1.livecode
2016-12-05 23:44:36 +01:00

20 lines
573 B
Text

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