1 USING: help.markup help.syntax quotations io.pathnames ;
2 IN: io.directories.hierarchy
4 HELP: directory-tree-files
5 { $values { "path" "a pathname string" } { "seq" "a sequence of filenames" } }
6 { $description "Outputs a sequence of all files and subdirectories inside the directory named by " { $snippet "path" } " or recursively inside its subdirectories." } ;
8 HELP: with-directory-tree-files
9 { $values { "path" "a pathname string" } { "quot" quotation } }
10 { $description "Calls the quotation with the recursive directory file names on the stack and with the directory set as the " { $link current-directory } ". Restores the current directory after the quotation is called." } ;
13 { $values { "path" "a pathname string" } }
14 { $description "Deletes a file or directory, recursing into subdirectories." }
15 { $errors "Throws an error if the deletion fails." }
16 { $warning "Misuse of this word can lead to catastrophic data loss." } ;
19 { $values { "from" "a pathname string" } { "to" "a pathname string" } }
20 { $description "Copies a directory tree recursively." }
21 { $notes "This operation attempts to preserve original file attributes, however not all attributes may be preserved." }
22 { $errors "Throws an error if the copy operation fails." } ;
25 { $values { "from" "a pathname string" } { "to" "a directory pathname string" } }
26 { $description "Copies a directory tree to another directory, recursively." }
27 { $errors "Throws an error if the copy operation fails." } ;
30 { $values { "files" "a sequence of pathname strings" } { "to" "a directory pathname string" } }
31 { $description "Copies a set of directory trees to another directory, recursively." }
32 { $errors "Throws an error if the copy operation fails." } ;
34 ARTICLE: "io.directories.hierarchy" "Directory hierarchy manipulation"
35 "The " { $vocab-link "io.directories.hierarchy" } " vocabulary defines words for operating on directory hierarchies recursively."
37 "There is a naming scheme used by " { $vocab-link "io.directories" } " and " { $vocab-link "io.directories.hierarchy" } ". Operations for deleting and copying files come in two forms:"
39 { "Words named " { $snippet { $emphasis "operation" } "-file" } " which work on regular files only." }
40 { "Words named " { $snippet { $emphasis "operation" } "-tree" } " works on directory trees recursively, and also accepts regular files." }
42 "Listing directory trees recursively:"
45 with-directory-tree-files
47 "Deleting directory trees recursively:"
48 { $subsections delete-tree }
49 "Copying directory trees recursively:"
56 ABOUT: "io.directories.hierarchy"