file_copy

file_copy(from_, to)

Copy files

Args: from_ (str | List[str]): Path to a file or a list of files to (str | List[str]): Path to a file or a list of files

Returns: the result of the call to shutil.copyfile or a list of these results in case from_ is a list

Examples: >>> from rlike import * >>> path = file_path(tempdir(), “test.txt”) >>> file_exists(path) False >>> f1 = writeLines(text = ‘Hello world. Some more text.’, con = ‘fname1.txt’) >>> out = file_copy(f1, path) >>> file_exists(path) True >>> readLines(path) [‘Hello world. Some more text.’] >>> test = file_remove([path, f1]) >>> test [None, None]