Handbook
Glossary
find-file ( path quot: ( ... name -- ... ? ) -- path/f )
Factor handbook
»
Input and output
»
Directory manipulation
»
Searching directories
Prev:
each-directory-entry ( path quot: ( ... entry -- ... ) -- )
Next:
find-files ( path quot: ( ... name -- ... ? ) -- paths )
Vocabulary
io
.
directories
Inputs
path
a pathname string
quot
a
quotation
Outputs
path/f
pathname string or
f
Word description
Finds the first file in the input directory matching the predicate quotation, in a breadth-first or depth-first
traversal-method
.
See also
find-files
,
find-file-in-directories
,
find-files-in-directories
Definition
USING:
io.directories.private
kernel
;
IN:
io.directories
:
find-file
( path quot: ( ... name -- ... ? ) -- path/f )
[
bfs?
<directory-iterator>
]
dip
[
1guard
]
curry
iterate-directory
;
inline