Directory hierarchy manipulation
Factor handbook > Input and output > Directory manipulation

Prev:Deleting, moving, and copying files

The io.directories.hierarchy vocabulary defines words for operating on directory hierarchies recursively.

There is a naming scheme used by io.directories and io.directories.hierarchy. Operations for deleting and copying files come in two forms:
Words named operation-file which work on regular files only.
Words named operation-tree works on directory trees recursively, and also accepts regular files.

Listing directory trees recursively:
directory-tree-files ( path -- seq )

with-directory-tree-files ( path quot -- )

Deleting directory trees recursively:
delete-tree ( path -- )

Copying directory trees recursively:
copy-tree ( from to -- )

copy-tree-into ( from to -- )

copy-trees-into ( files to -- )