move function
Implementation
void move(String from, String to, {bool overwrite = false}) {
var dest = to;
if (isDirectory(to)) {
dest = p.join(to, p.basename(from));
}
if (!overwrite && exists(dest)) {
StatusHelper.failed('The [to] path ${truepath(dest)} already exists.');
}
try {
File(from).renameSync(dest);
} on FileSystemException catch (_) {
/// Invalid cross-device link
/// We can't move files across a partition so
/// do a copy/delete.
copy(from, to, overwrite: overwrite);
delete(from);
}
/// ignore: avoid_catches_without_on_clauses
catch (e) {
StatusHelper.failed('error: $e');
}
}