mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Win32: Add win32 rename function that overwrites existing targets.
This commit is contained in:
parent
5543d20441
commit
24796539ff
@ -338,6 +338,18 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
|
||||
}
|
||||
|
||||
int csync_vio_local_rename(const char *olduri, const char *newuri) {
|
||||
#ifdef _WIN32
|
||||
if(olduri && newuri) {
|
||||
if (MoveFileEx(olduri, newuri, MOVEFILE_COPY_ALLOWED + MOVEFILE_REPLACE_EXISTING + MOVEFILE_WRITE_THROUGH )) {
|
||||
return 0;
|
||||
}
|
||||
errno = GetLastError();
|
||||
} else {
|
||||
errno = ENOENT;
|
||||
}
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
return rename(olduri, newuri);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user