FYI - none of what is happening below is a problem with the regular file system.
We have an application that is storing a set of text files (YAML) to a subdirectory of Documents, which is mapped to OneDrive.
Lets call this subdirectory "Library1" and it contains YAML files such as "Library1.yaml".
This YAML file also contains text referencing "Library1".
We have ability to rename this library from within the application. If I rename "Library1" to "Library2" the code performs the following steps:
Rename the Library1 folder to Library2
Update Library2/Library1.yaml file content to "Library2"
Rename the Library2/Library1.yaml to Library2/Library2.yaml.
Problem is when the sync process executes it produces an error dialog "You now have two copies of a file...We couldn't merge the changes in "XXXXX' so we created another copy of it."
We end up with 2 files, Library2.yaml and Library2-ABC.yaml
Library2.yaml does not contains the changes and Library2-ABC.yaml contains the all the correct changes.
My assumption is that changing the file content and also renaming the file is causing OneDrive problems merging the changes...it is seeing conflicts perhaps.
I did try the "Always keep on the device" option on the parent folder and this did not help.
I assume disabling the sync for the Library folder is another option...but I cannot see any ability to do this when creating a folder from within the code.
I cannot see anyway around this problem, code-wise, without doing the file/folder operations outside OneDrive (such as a temporary directory) and then copying the folder back to OneDrive.
Any alternative suggestions would be appreciated. Thanks