Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP: Support php.mv() between devices via recursive copy #1411

Merged
merged 6 commits into from
May 16, 2024

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

FYI @bgrgicak @brandonpayton @wojtekn @sejas @fluiddot

@adamziel adamziel merged commit 914b270 into trunk May 16, 2024
5 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant