mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: rework mv so it works with different partitions (add fallback to os.mv_by_cp + tests) (#17065)
This commit is contained in:
@ -123,6 +123,20 @@ pub fn cp(src string, dst string) ! {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn rename(src string, dst string) ! {
|
||||
$if js_node {
|
||||
err := ''
|
||||
#try {
|
||||
#$fs.renameSync(src.str,dst.str);
|
||||
#return;
|
||||
#} catch (e) {
|
||||
#err.str = 'failed to rename ' + src.str + ' to ' + dst.str + ': ' + e.toString();
|
||||
#}
|
||||
|
||||
return error(err)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn read_file(s string) !string {
|
||||
mut err := ''
|
||||
err = err
|
||||
|
Reference in New Issue
Block a user