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:
@@ -126,6 +126,11 @@ pub fn mv_by_cp(source string, target string) ! {
|
||||
rm(source)!
|
||||
}
|
||||
|
||||
// mv moves files or folders from `src` to `dst`.
|
||||
pub fn mv(source string, target string) ! {
|
||||
rename(source, target) or { mv_by_cp(source, target)! }
|
||||
}
|
||||
|
||||
// read_lines reads the file in `path` into an array of lines.
|
||||
[manualfree]
|
||||
pub fn read_lines(path string) ![]string {
|
||||
|
||||
Reference in New Issue
Block a user