copySync static method
Copies this file.
If to
is a relative path, it is resolved against
the current working directory (Env.currentDirectory).
If to
identifies an existing file, that file is
removed first. If to
identifies an existing directory, the
operation fails and the future completes with an IoError.
Implementation
static Result<(), IoError> copySync(Path from, Path to) {
return Fs.ioGuardSync(() => File(from.asString()).copySync(to.asString()))
.map((_) => ());
}