wendlers / mpfshell

A simple shell based file explorer for ESP8266 Micropython based devices ⛺
MIT License
396 stars 84 forks source link

Files in subdirectories inaccessible if running mpfshell from Windows #71

Closed eirinnm closed 5 years ago

eirinnm commented 5 years ago

On micropython systems with the /flash subdirectory, all get/put commands fail when running mpfshell from Windows. This is caused by the use of os.path.join in mpfexp.py which results in file paths joined with \\ instead of /. Micropython's file system uses /.

I managed to fix it by import posixpath in mpfexp.py followed by replacing all instances of os.path.join with posixpath.join.

skorokithakis commented 5 years ago

Would you care to issue a PR? This shouldn't break existing functionality, right?

skorokithakis commented 5 years ago

Hmm, is that module in the standard library?

eirinnm commented 5 years ago

Yep, I'll do a PR.

It's in the standard library, but I'm not sure if it's the 'best' way of forcing posix-like paths. Some documentation here: https://docs.python.org/3/library/pathlib.html