Skip to content

Instantly share code, notes, and snippets.

@rgchris
Last active February 5, 2019 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgchris/f76521beb946050951a09ecb105ab2b0 to your computer and use it in GitHub Desktop.
Save rgchris/f76521beb946050951a09ecb105ab2b0 to your computer and use it in GitHub Desktop.
Return a list of a folder's content (recursive)
Rebol [
Title: "Return a listing of a folder's content"
Date: 4-Feb-2019
Author: "Christopher Ross-Gill"
Rights: http://opensource.org/licenses/Apache-2.0
]
deep-list: func [
source [file!]
/hidden /folders
][
try collect [
for-each file read source [
case [
all [
not hidden
parse file ["."]
][
; ignore
]
dir? file [
if folders [
keep/line file
]
for-each kid deep-list source/:file [
keep/line file/:kid
]
]
file [keep/line file]
]
]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment