micropython / micropython

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
https://micropython.org
Other
19.52k stars 7.82k forks source link

mpremote cannot create subfolders in a mounted folder - Windows #7758

Closed Josverl closed 2 years ago

Josverl commented 3 years ago

When using mpremote on Windows it appears not to be able to create directories in a mounted folder. Minimal repro:

(.venv) PS C:\develop\MyPython\micropython-stubber\board> 
mpremote mount . exec "import os;os.mkdir('spam')" 
Local directory . is mounted at /remote
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'RemoteFS' object has no attribute 'mkdir'
(.venv) PS C:\develop\MyPython\micropython-stubber\board> 

and similar issues rise when importing a module that tries to create subfolders. looking at the code indeed no mkdir method has been implemented. Is this intentional , or something that could be added ?

dpgeorge commented 2 years ago

mkdir and rmdir were added to mpremote in 7566d107d5acc82a45df0dd5c5803bf5d2564043