Skip to content

listdir() & listdir("./") do not work the same. Mounts are ignored. #8409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bill88t opened this issue Sep 18, 2023 · 2 comments · Fixed by #10263
Closed

listdir() & listdir("./") do not work the same. Mounts are ignored. #8409

bill88t opened this issue Sep 18, 2023 · 2 comments · Fixed by #10263
Assignees
Milestone

Comments

@bill88t
Copy link

bill88t commented Sep 18, 2023

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.1-40-g17ced21e04 on 2023-09-14; M5Stack Timer Camera X with ESP32

Code/REPL

# mount a vfs under /something
import os
os.listdir()
os.listdir("./")

Behavior

>>> listdir()
['ramdisk', 'LjinuxRoot', 'code.py', 'lib', 'boot_out.txt', 'ftp_serv.py', 'boot.py', 'repl.py', 'settings.toml']
>>> listdir("./")
['LjinuxRoot', 'code.py', 'lib', 'boot_out.txt', 'ftp_serv.py', 'boot.py', 'repl.py', 'settings.toml']
>>> 

Description

I just started playing with ramdisk more, and I noticed my ls was just.. not seeing it..

Additional information

No response

@bill88t bill88t added the bug label Sep 18, 2023
@bill88t bill88t changed the title listdir() vs listdir("./") does not work the same way on / listdir() & listdir("./") does not work the same way on / Sep 18, 2023
@bill88t bill88t changed the title listdir() & listdir("./") does not work the same way on / listdir() & listdir("./") do not work the same. Mounts are ignored. Sep 18, 2023
@RetiredWizard
Copy link

I believe I ran into a similar issue with SD card mounts.

@tannewt tannewt added this to the Long term milestone Sep 18, 2023
@RetiredWizard
Copy link

RetiredWizard commented Sep 18, 2023

When the os.listdir('..') is run from a mounted directory (SD card anyway) the mounted folder is listed rather than the root folder. I.E. the ".." directory shortcut can't parse up thorough a mount point.

The os.chdir('..') command has the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants