[WASMFS] Workaround for missing directory rename in OPFS #24227
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The origin private file system does not support directory rename. I don't know why.
This PR will implement a workaround for that that will only execute after the rename attempt throws an exception, so that if/when OPFS ever supports the move() method on a directory handle, it will be used instead of this workaround with no code change needed.
This is accomplished by creating new directories in the target, and moving the files into them, recursively.
One side effect is that the handle cache for the renamed directory will be cleared, since the file and directory handles will be different.
Fixes: #24162
I don't know how to fix the circleci failures that seem unrelated to this code change.