wendlers / mpfshell

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

ls does not list files created on the esp8266 #36

Closed craftyguy closed 5 years ago

craftyguy commented 7 years ago

Steps to reproduce:

1) in repl/webrepl:

>>> with open('app', 'w') as f:
>>>    f.write("hello")

2) in mpfshell:

mpfs [/]> ls

Remote files in '/':

3) in repl/webrepl:

>>> import os
>>> os.listdir()
['app']

4) in mpfshell:

mpfs [/]> cat app
hello
wendlers commented 7 years ago

Yes, this is due to the fact, that the shell uses caching by default. For now, you could add --nocache when calling the shell like so:

mpfshell --nocache

An other solution would be to invalidate the cache at the moment we return from REPL to the shell prompt. I will flag this as an enhancement.

skorokithakis commented 5 years ago

Fixed, thank you!