mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-23 16:12:12 +02:00
* Resolve to correctly handle file case sensitivity issues in same folder by using the same mechanism as Issue #139
This commit is contained in:
parent
b2c9e041be
commit
ce311db18d
14
src/sync.d
14
src/sync.d
|
@ -1265,6 +1265,14 @@ final class SyncEngine
|
|||
}
|
||||
}
|
||||
|
||||
// Check that the filename that is returned is actually the file we wish to upload
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file
|
||||
// Do not assume case sensitivity. For example, consider the names OSCAR, Oscar, and oscar to be the same,
|
||||
// even though some file systems (such as a POSIX-compliant file system) may consider them as different.
|
||||
// Note that NTFS supports POSIX semantics for case sensitivity but this is not the default behavior.
|
||||
|
||||
if (fileDetailsFromOneDrive["name"].str == baseName(path)){
|
||||
// OneDrive 'name' matches local path name
|
||||
log.vlog("Requested file to upload exists on OneDrive - local database is out of sync for this file: ", path);
|
||||
|
||||
// Is the local file newer than the uploaded file?
|
||||
|
@ -1309,6 +1317,12 @@ final class SyncEngine
|
|||
log.vlog("Updating the local database with details for this file: ", path);
|
||||
saveItem(fileDetailsFromOneDrive);
|
||||
}
|
||||
} else {
|
||||
// The files are the "same" name wise but different in case sensitivity
|
||||
log.error("ERROR: A local file has the same name as another local file.");
|
||||
log.error("ERROR: To resolve, rename this local file: ", absolutePath(path));
|
||||
log.log("Skipping uploading this new file: ", absolutePath(path));
|
||||
}
|
||||
} else {
|
||||
// Skip file - too large
|
||||
log.log("Skipping uploading this new file as it exceeds the maximum size allowed by OneDrive: ", path);
|
||||
|
|
Loading…
Reference in a new issue