i'm making a file tool in rust with tauri.
i'm new to low level programing, i have done very little in c (never any async or sys functions).
i want to enumerate all the files in a directory. and get their absolute path respectively.
i followed the example but it doesn't like it.
async fn visit_directory(app_handle: &tauri::AppHandle, dir: &Path) -> Result<DirectoryResult, ()> {
let mut file_count = 0;
for entry in fs::read_dir(dir) {
let path = entry.path();
println!("{}", path.display());
if path.is_dir() {
error:
error[E0599]: no method named `path` found for struct `ReadDir` in the current scope
--> src\main.rs:26:22
|
26 | let path = entry.path();
| ^^^^ method not found in `ReadDir`
Returns an iterator over the entries within a directory.