← index #15963Issue #17267
Off-topic · high · value 1.657
QUERY · ISSUE

mpremote: Behaviour is confusing with multiple mountpoints

openby peterhinchopened 2024-10-04updated 2024-11-02
enhancementtools

Description

Follow on from https://github.com/micropython/micropython/pull/11777#issuecomment-2390338451.

To the naive user of a system with multiple mounted filesystems the behaviour of

$ mpremote cp foo.py :  

seems nondeterministic, because the destination of the copy can only be established with knowledge of the state of the target (its current directory). The same applies to

$ mpremote ls : 

The following change would provide a deterministic and more discoverable interface.

  1. Where there is only one mounted filesystem, behaviour remains exactly as currently.
  2. Where there are multiple filesystems behaviour is as follows:

mpremote ls : produces a list of mountpoints (as per ls : /).
mpremote cp foo.py : throws an exception because you cannot write to '/'.
mpremote cp foo.py :/sd/ works as at present.

While this is a breaking change, an inability to write to '/' will not surprise anyone familiar with the MP directory structure.

Code Size

No response

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

mpremote gives false error if a destination directory doesn't exist for recursive copy

openby mattvennopened 2025-05-08updated 2025-09-05
bugtools

Port, board and/or hardware

rp2040

MicroPython version

MicroPython v1.24.0 on 2024-10-25; Raspberry Pi Pico with RP2040

Reproduction

create a directory 'test' on the target and 'local' on host
then run:

mpremote cp -r local  :testt 

note typo in destination

Expected behaviour

the error message should be 'destination doesn't exist'

Observed behaviour

cp local :testt
mpremote: cp: -r not specified; omitting directory

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied