module FileUtils
Extended Modules
Defined in:
file_utils.crInstance Method Summary
- #cmp(stream1 : IO, stream2 : IO)
- #cmp(filename1 : String, filename2 : String)
-
#cp(srcs : Enumerable(String), dest : String)
Copies a list of files src to dest.
-
#cp(src_path : String, dest : String)
Copies the file src_path to the file or directory dest.
-
#cp_r(src_path : String, dest_path : String)
Copies a file or directory src_path to dest_path If src_path is a directory, this method copies all its contents recursively
` FileUtils.cp_r("src_dir", "src_dir_copy")
`
-
#rm_r(path : String)
Deletes a file or directory path If path is a directory, this method removes all its contents recursively
` FileUtils.rm_r("dir") FileUtils.rm_r("file.cr")
`
Instance Method Detail
Copies a list of files src to dest. dest must be an existing directory.
FileUtils.cp({"cgi.cr", "complex.cr", "date.cr"}, "files")
Copies the file src_path to the file or directory dest. If dest is a directory, a file with the same basename as src_path is created in dest Permission bits are copied too.
FileUtils.cp("file_utils.cr", "file_utils_copy.cr")
Copies a file or directory src_path to dest_path If src_path is a directory, this method copies all its contents recursively
FileUtils.cp_r("src_dir", "src_dir_copy")
Deletes a file or directory path If path is a directory, this method removes all its contents recursively
FileUtils.rm_r("dir")
FileUtils.rm_r("file.cr")