microsoft / ProjFS-Managed-API

A managed-code API for the Windows Projected File System
Other
142 stars 34 forks source link

Revert full state file keeping it hydrated #65

Closed lucasorth closed 2 years ago

lucasorth commented 3 years ago

Is there a way to revert a file from Full state to a Hydrated Placeholder state? Explaining: When open and edit a file for the first time, the PreConvertToFull callback is called, where I can control if the file is available for "Checkout" and subsequent allow user to edit the content or not. When user submit changes to the provider store, I want to mark the file as "synchronized" with the provider. This allows the PreConvertToFull callback to be called again in next time. I tried using the UpdateFileIfNeeded for this, and to some extent that's what I need, however it discards the content, causing a hydrate to be called later. This is a disadvantage when I have to deal with really big files, I would like to avoid hydrate as much as possible, keeping the copy up-to-date in the user's location whenever possible.

cgallred commented 3 years ago

Unfortunately there isn't a way to go from Full to Hydrated Placeholder. I've added an item to our backlog to consider it for a future release.

lucasorth commented 3 years ago

Thanks for considering this, it will be very helpful.