- Index
- »
- io
- »
- func:ioCopy
def
func:ioCopy
ioCopy(from, to, opts: {})
Copy a file or directory to the new specified location. If this file represents a directory, then it recursively copies the entire directory tree. Both handles must reference a local file or directory on the file system.
If during the copy, an existing file of the same name is found, then the "overwrite" option should be to marker or true
to overwrite or false
to skip. Or if overwrite is not defined then an IOErr is raised.
Examples:
ioCopy(`io/dir/`, `io/dir-copy/`) ioCopy(`io/file.txt`, `io/file-copy.txt`) ioCopy(`io/file.txt`, `io/file-copy.txt`, {overwrite}) ioCopy(`io/file.txt`, `io/file-copy.txt`, {overwrite:false})