Open remram44 opened 2 years ago
ya - listdir
was added very early on and has a bunch of semantics that made sense at the time, but are very different from python's os.listdir
. I wonder if we should simply deprecate it and add a new os.listdir
that matches the python semantics.
related issue: https://github.com/tilt-dev/tilt/issues/3806
Describe the Feature You Want
It should be possible to list subdirectories.
Current Behavior
listdir()
lists files only, not directories.Why Do You Want This?
I am building the
live_update
config for my app. Some directories are ok to live-reload (so I usesync()
), and I want all others to go intofall_back_on()
.Additional context There should probably be a way to tell whether a path is a file or a directory (like Python's
isfile()
andisdir()
).I managed to hack together a list of (non-empty) subdirectories from the recursive list of files: gist. This works but is a huge hack (and the
/
handling is probably not portable)