I am creating a virtual file system using Cloud Files API. I am trying to implement rename/move and delete operations for folders. The rename folder with overwrite scenario (when the target folder exists) behavior is confusing. In Windows Explored I am trying to rename Z:\Folder1 to Z:\Folder2 while the Z:\Folder2 already exists. Before the the rename operation is performed, the source folder is being deleted by calling CF_CALLBACK_TYPE_NOTIFY_DELETE callback.
Here is the sequence of callbacks that I get with Cloud Filter API:
As a result there is no way to delete a folder in my storage inside the CF_CALLBACK_TYPE_NOTIFY_DELETE callback because this will delete all files prior to the move operation. Also there is no way to distinguish between delete and move operations inside the CF_CALLBACK_TYPE_NOTIFY_DELETE (so I can ignore it for the move operation).
How do I properly implement the delete and rename/move callbacks in Cloud Files API?
It is specific of Windows File Manager. I tried "Move" operation using PowerShell "Move-Item" with "-Force" option and I got next sequence of callbacks (without delete callbacks):