find-file ( path bfs? quot -- path/f )
Searching directories
Prev:each-file ( path bfs? quot -- )
Next:find-all-files ( path quot -- paths/f )


Vocabulary
io.directories.search

Inputs and outputs
patha pathname string
bfs?a boolean, breadth-first or depth-first
quota quotation
path/fa 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.

See also
find-all-files, find-in-directories, find-all-in-directories

Definition
USING: io.directories.search.private kernel ;

IN: io.directories.search

: find-file ( path bfs? quot -- path/f )
[ <directory-iterator> ] dip [ keep and ] curry
iterate-directory ; inline