make find-all-files and find-in-program-files not take the traversal method
parent
e1b4e8c66f
commit
de9154fc5e
|
@ -38,7 +38,7 @@ HELP: find-in-directories
|
|||
|
||||
HELP: find-all-files
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "bfs?" "a boolean, breadth-first or depth-first" } { "quot" quotation }
|
||||
{ "path" "a pathname string" } { "quot" quotation }
|
||||
{ "paths/f" "a sequence of pathname strings or f" }
|
||||
}
|
||||
{ $description "Finds all files in the input directory matching the predicate quotation in a breadth-first or depth-first traversal." } ;
|
||||
|
|
|
@ -5,6 +5,6 @@ IN: io.directories.search.tests
|
|||
[ t ] [
|
||||
[
|
||||
10 [ "io.paths.test" "gogogo" make-unique-file ] replicate
|
||||
current-temporary-directory get t [ ] find-all-files
|
||||
current-temporary-directory get [ ] find-all-files
|
||||
] with-unique-directory drop [ natural-sort ] bi@ =
|
||||
] unit-test
|
||||
|
|
|
@ -51,7 +51,8 @@ PRIVATE>
|
|||
[ keep and ] curry iterate-directory
|
||||
] [ drop f ] recover ; inline
|
||||
|
||||
: find-all-files ( path bfs? quot: ( obj -- ? ) -- paths/f )
|
||||
: find-all-files ( path quot: ( obj -- ? ) -- paths/f )
|
||||
f swap
|
||||
'[
|
||||
_ _ _ [ <directory-iterator> ] dip
|
||||
pusher [ [ f ] compose iterate-directory drop ] dip
|
||||
|
|
|
@ -7,7 +7,7 @@ IN: io.directories.search.windows
|
|||
: program-files-directories ( -- array )
|
||||
program-files program-files-x86 2array harvest ; inline
|
||||
|
||||
: find-in-program-files ( base-directory bfs? quot -- path )
|
||||
[
|
||||
: find-in-program-files ( base-directory quot -- path )
|
||||
t swap [
|
||||
[ program-files-directories ] dip '[ _ append-path ] map
|
||||
] 2dip find-in-directories ; inline
|
||||
|
|
Loading…
Reference in New Issue