+ "Operations for deleting and copying files come in two forms:"
+ { $list
+ { "Words named " { $snippet { $emphasis "operation" } "-file" } " which work on regular files only." }
+ { "Words named " { $snippet { $emphasis "operation" } "-tree" } " works on directory trees recursively, and also accepts regular files." }
+ }
+ "The operations for moving and copying files come in three flavors:"
+ { $list
+ { "A word named " { $snippet { $emphasis "operation" } } " which takes a source and destination path." }
+ { "A word named " { $snippet { $emphasis "operation" } "-to" } " which takes a source path and destination directory. The destination file will be stored in the destination directory and will have the same file name as the source path." }
+ { "A word named " { $snippet { $emphasis "operation" } "s-to" } " which takes a sequence of source paths and destination directory." }
+ }
+ "Since both of the above lists apply to copying files, that this means that there are a total of six variations on copying a file."
+ $nl
+ "Deleting files:"
{ $subsection delete-file }
- { $subsection make-directory }
{ $subsection delete-directory }
- "Current and home directories:"
- { $subsection home }
- { $subsection cwd }
- { $subsection cd }
- "Pathnames relative to the Factor install directory:"
- { $subsection resource-path }
- { $subsection ?resource-path }
- "Pathname presentations:"
- { $subsection pathname }
- { $subsection <pathname> }
+ { $subsection delete-tree }
+ "Moving files:"
+ { $subsection move-file }
+ { $subsection move-file-to }
+ { $subsection move-files-to }
+ "Copying files:"
+ { $subsection copy-file }
+ { $subsection copy-file-to }
+ { $subsection copy-files-to }
+ "Copying directory trees recursively:"
+ { $subsection copy-tree }
+ { $subsection copy-tree-to }
+ { $subsection copy-trees-to }
+ "On most operating systems, files can only be moved within the same file system. To move files between file systems, use " { $link copy-file } " followed by " { $link delete-file } " on the old name." ;
+
+ ARTICLE: "io.files" "Basic file operations"
+ "The " { $vocab-link "io.files" } " vocabulary provides basic support for working with files."
+ { $subsection "pathnames" }
+ { $subsection "file-streams" }
+ { $subsection "fs-meta" }
+ { $subsection "directories" }
+ { $subsection "delete-move-copy" }
+ { $subsection "unique" }
{ $see-also "os" } ;
- ABOUT: "file-streams"
+ ABOUT: "io.files"
+
+ HELP: path-separator?
+ { $values { "ch" "a code point" } { "?" "a boolean" } }
+ { $description "Tests if the code point is a platform-specific path separator." }
- "Convert a file of 4-byte cells from little to big endian or vice versa, by directly mapping it into memory:"
+ "Convert a file of 4-byte cells from little to big endian or vice versa, by directly mapping it into memory and operating on it with sequence words:"
index 2a8a8e20c0f001b2e4f62c9728695375689fcfc6,0000000000000000000000000000000000000000..e89bb0064500baaa28ad04fc2dbde221805e632f
mode 100644,000000..100644