Skip to content

Commit 09c5249

Browse files
fs_driver.py: don't remove / from /
1 parent 04a27b0 commit 09c5249

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal_filesystem/lib/mpos/fs_driver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ def _fs_dir_open_cb(drv, path):
7979
#print(f"_fs_dir_open_cb for path '{path}'")
8080
try:
8181
import os # for ilistdir()
82-
path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL
82+
if path != "/":
83+
path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL
8384
return {'iterator' : os.ilistdir(path)}
8485
except Exception as e:
85-
print(f"_fs_dir_open_cb exception: {e}")
86+
print(f"_fs_dir_open_cb exception for path {path}: {e}")
8687
return None
8788

8889
def _fs_dir_read_cb(drv, lv_fs_dir_t, buf, btr):

0 commit comments

Comments
 (0)