Get All The Directories In A Directory Non-Recursively In Rust
This is how I'm getting a single list of directories in a given directory without recursing into it. (It also filters out directories that start with .
or $
---
anyhow = "1.0.98"
---
use Result;
use fs;
use PathBuf;
Output:
/Users/alan/Desktop/Untitled Session 1
/Users/alan/Desktop/tmp_video
/Users/alan/Desktop/$RECYCLE.BIN
/Users/alan/Desktop/Extending RSS 2.0 With Namespaces_files
/Users/alan/Desktop/Old Firefox Data
/Users/alan/Desktop/avif_gif_test
/Users/alan/Desktop/download_test
/Users/alan/Desktop/NEOPOLITAN-MOVE
Old notes
use fs;
use PathBuf;
use Error;
Output:
[_active_nvim_run:9:19] dirs = [
"/Users/alan/Desktop/Untitled Session 1",
"/Users/alan/Desktop/tmp_video",
"/Users/alan/Desktop/Extending RSS 2.0 With Namespaces_files",
"/Users/alan/Desktop/Old Firefox Data",
"/Users/alan/Desktop/avif_gif_test",
"/Users/alan/Desktop/download_test",
"/Users/alan/Desktop/NEOPOLITAN-MOVE",
]
-- end of line --