Skip to content

Instantly share code, notes, and snippets.

@rgchris rgchris/deep-list.reb
Last active Feb 5, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.