BurntSushi/walkdir

Error from reading a directory without permission doesn't give path

Open

#126 aberto em 26 de jul. de 2019

Ver no GitHub
 (2 comments) (1 reaction) (0 assignees)Rust (125 forks)github user discovery
help wantedquestion

Métricas do repositório

Stars
 (1.504 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

When iterating over the WalkDir dictionary in Windows 10, rust stable 1.36, if the user does not have permission to read a directory, an error is given, but not the actual path. When hitting an error with files, the path in the error is displayed but not with directories for some reason:

Error on entry 'Err(Error { depth: 2, inner: Io { path: None, err: Os { code: 5, kind: PermissionDenied, message: "Access is denied." } } })': Error { depth: 2, inner: Io { path: None, err: Os { code: 5, kind: PermissionDenied, message: "Access is denied." } } }

    for entry in WalkDir::new(some_path){
        prepath = match &entry {
            Ok(path) => { 
                path
            }
            Err(err) => {
                println!("Error on entry '{:?}': {:?}", entry, err);             
                continue
            }
        };

Guia do colaborador