Skip to content

Commit 6fc8732

Browse files
committed
FEAT: wildcard function - returns block of absolute path files filtered using * and ? wildcards.
1 parent 9be0686 commit 6fc8732

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/mezz/base-files.reb

+14
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ split-path: func [
176176
reduce [dir pos]
177177
]
178178

179+
wildcard: func [
180+
"Return block of absolute path files filtered using wildcards."
181+
path [file!] "Source directory"
182+
value [any-string!] "Search value with possible * and ? wildcards"
183+
/local result
184+
][
185+
result: make block! 8
186+
path: clean-path/dir path
187+
foreach file read path [
188+
if find/match/any file value [ append result path/:file ]
189+
]
190+
new-line/all result true
191+
]
192+
179193
intern: function [
180194
"Imports (internalize) words and their values from the lib into the user context."
181195
data [block! any-word!] "Word or block of words to be added (deeply)"

0 commit comments

Comments
 (0)