You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
fs_driver.py: don't remove / from /
This commit is contained in:
@@ -79,10 +79,11 @@ def _fs_dir_open_cb(drv, path):
|
||||
#print(f"_fs_dir_open_cb for path '{path}'")
|
||||
try:
|
||||
import os # for ilistdir()
|
||||
path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL
|
||||
if path != "/":
|
||||
path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL
|
||||
return {'iterator' : os.ilistdir(path)}
|
||||
except Exception as e:
|
||||
print(f"_fs_dir_open_cb exception: {e}")
|
||||
print(f"_fs_dir_open_cb exception for path {path}: {e}")
|
||||
return None
|
||||
|
||||
def _fs_dir_read_cb(drv, lv_fs_dir_t, buf, btr):
|
||||
|
||||
Reference in New Issue
Block a user