with-directory-files ( path quot -- )
Factor handbook » Input and output » Directory manipulation » Directory listing

Prev:with-directory-entries ( path quot -- )
Next:qualified-directory-entries ( path -- seq )


Vocabulary
io.directories

Inputs
patha pathname string
quota quotation


Outputs
None

Word description
Calls the quotation with the directory file names on the stack and with the directory set as the current-directory. Restores the current directory after the quotation is called.

Examples
Print all files in your home directory which are larger than a megabyte:
USING: io.directories io.files.info io.pathnames ; home [ [ dup link-info size>> 20 2^ > [ print ] [ drop ] if ] each ] with-directory-files


Definition