We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents af3eb41 + 63899f1 commit 2fa61e1Copy full SHA for 2fa61e1
1 file changed
api_drivers/py_api_drivers/fs_driver.py
@@ -78,9 +78,11 @@ def _fs_dir_open_cb(drv, path):
78
#print(f"_fs_dir_open_cb for path '{path}'")
79
try:
80
import os # for ilistdir()
81
+ if path != "/":
82
+ path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL
83
return {'iterator' : os.ilistdir(path)}
84
except Exception as e:
- print(f"_fs_dir_open_cb exception: {e}")
85
+ print(f"_fs_dir_open_cb exception for path {path}: {e}")
86
return None
87
88
def _fs_dir_read_cb(drv, lv_fs_dir_t, buf, btr):
0 commit comments