← index #2929PR #17295
Off-topic · high · value 0.518
QUERY · ISSUE

VFS FatFS: mkdir with trailing slash fails when it should succeed

openby dpgeorgeopened 2017-03-03updated 2017-03-08

On CPython and unix uPy, os.mkdir('directory/') makes the requested directory. But on bare metal ports using VFS with FatFS it fails with ENOENT because of the trailing slash. I'd say this should be fixed. (And in fact CPy and unix uPy allow any number of trailing slashes).

CANDIDATE · PULL REQUEST

extmod/vfs_lfsx: Fix errno value raised from chdir.

mergedby dpgeorgeopened 2025-05-13updated 2025-05-15
extmod

Summary

Littlefs was raising a negative errno if chdir failed, when it should be a positive errno.

Testing

Tests have been updated to cover this case (and other cases which were already correct).

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied