Skip to content

WebREPL put: long paths use the file channel and a rename - #201

Merged
bdbarnett merged 1 commit into
mainfrom
webrepl-long-put
Nov 3, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
webrepl-long-put

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

A path over 63 bytes doesn't fit the file channel's header, so put fell 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-put at 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.py has a new test for the sequence.

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.
@bdbarnett
bdbarnett merged commit 428bc18 into main Nov 3, 2026
8 checks passed
@bdbarnett
bdbarnett deleted the webrepl-long-put branch November 3, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant