module FileUtils

Extended Modules

Defined in:

file_utils.cr

Instance Method Summary

Instance Method Detail

def cmp(stream1 : IO, stream2 : IO) #

[View source]
def cmp(filename1 : String, filename2 : String) #

[View source]
def cp(srcs : Enumerable(String), dest : String) #

Copies a list of files src to dest. dest must be an existing directory.

FileUtils.cp({"cgi.cr", "complex.cr", "date.cr"}, "files")

[View source]
def cp(src_path : String, dest : String) #

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")

[View source]
def 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")

[View source]
def 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")

[View source]