Repository navigation
WebREPL put: long paths use the file channel and a rename - #201
Merged
Merged
Conversation
The channel's header holds 63 bytes of name. Longer paths fell back to writing through the REPL, which stalled on a real board. Uploading under a short name on the same filesystem and renaming moves the same files at the channel's speed: 300 KB to a 73-byte path on an SD card took 9.5 s, hash matched, and no temporary file stayed behind.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A path over 63 bytes doesn't fit the file channel's header, so
putfell back to writing through the REPL. On an ESP32-P4 that fallback stalled with "no data for 20 s" on every file under a deep folder.Now the file goes up under
.mpftp-putat the top of the destination's filesystem and is renamed into place. If the rename can't land, for example across a mount, the temporary file is removed and the REPL path still runs.Tested over WebREPL on a real board: 300 KB to a 73-byte path on an SD card took 9.5 s, the on-board hash matched, and nothing stayed behind.
test_webrepl.pyhas a new test for the sequence.