find-files-by-extension ( path extension -- seq )
Factor handbook » Input and output » Directory manipulation » Searching directories

Prev:find-files-in-directories ( directories quot: ( ... name -- ... ? ) -- paths/f )
Next:find-files-by-extensions ( path extensions -- seq )


Vocabulary
io.directories

Inputs
patha pathname string
extensiona file extension


Outputs
seqa sequence


Word description
Searches a directory for all files with the given extension. File extension and filenames are converted to lower-case and compared using the tail? word. The file extension should contain the period.

Examples
USING: io.directories ; "/" ".mp3" find-by-extension


Definition