Skip to content

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented May 16, 2024

Before this PR, php.mv() from MEMFS to NODEFS would fail. With this PR, it works.

Technically, this PR checks if fromPath and toPath belong to the same mountpoint. If yes, it calls a fast FS.rename() function. If not, it runs a slower recursive copy followed by recursive remove of the fromPath.

This runs the entire recursive copy and only then runs the recursive delete. I wonder if deleting each copied item as we go would make more sense?

This PR also brings in the Emscripten TS types as they made working with the FS object much easier.

Testing Instructions

Review the new unit test and confirm it passes.

@adamziel
Copy link
Collaborator Author

adamziel commented May 16, 2024

@adamziel adamziel merged commit 914b270 into trunk May 16, 2024
@adamziel adamziel deleted the mv-or-copy-recursive branch May 16, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment