Hi,
To answer your new questions:
“The metadata of the placeholder file is missing, so I can’t judge the meta version. It’s by design?”
Yes, the process goes like this:
- Overwriting/replacing a placeholder with a normal file removes the Cloud Files (M$CF) reparse point.
- Once that’s gone, CFAPI no longer has the placeholder metadata or your meta version.
- CFAPI does not preserve or merge the old identity/version for you in this replace scenario.
“What can I do for this?”
- Detect that the placeholder was overwritten (e.g.
CfGetPlaceholderStateand/or directory change monitoring likeReadDirectoryChangesW/ USN). - Treat the result as a new local edit: upload the content to your service and assign a new remote version.
- Call
CfConvertToPlaceholderon the now-normal file to attach a fresh identity (with your new version), thenCfSetInSyncStatewhen it’s in sync. - Keep your own versioning/metadata store so you can reason about versions even when the on-disk placeholder metadata (reparse point) is lost (optional but I think it would be essential if you're creating a full application).
Also note that the Cloud Files / Cloud Filter API is not a full sync engine. It only manages placeholders and hydration on the local file system. All higher-level sync behavior like version tracking, conflict resolution, and any extra metadata, you have to implement in your own sync engine (typically using your own local/remote metadata store) and then drive CFAPI with the appropriate calls.