Struct walkdir::DirEntry [] [src]

pub struct DirEntry { /* fields omitted */ }

A directory entry.

This is the type of value that is yielded from the iterators defined in this crate.

Differences with std::fs::DirEntry

This type mostly mirrors the type by the same name in std::fs. There are some differences however:

Methods

impl DirEntry
[src]

The full path that this entry represents.

The full path is created by joining the parents of this entry up to the root initially given to WalkDir::new with the file name of this entry.

Note that this always returns the path reported by the underlying directory entry, even when symbolic links are followed. To get the target path, use path_is_symbolic_link to (cheaply) check if this entry corresponds to a symbolic link, and std::fs::read_link to resolve the target.

Returns true if and only if this entry was created from a symbolic link. This is unaffected by the follow_links setting.

When true, the value returned by the path method is a symbolic link name. To get the full target path, you must call std::fs::read_link(entry.path()).

Return the metadata for the file that this entry points to.

This will follow symbolic links if and only if the WalkDir value has follow_links enabled.

Platform behavior

This always calls std::fs::symlink_metadata.

If this entry is a symbolic link and follow_links is enabled, then std::fs::metadata is called instead.

Return the file type for the file that this entry points to.

If this is a symbolic link and follow_links is true, then this returns the type of the target.

This never makes any system calls.

Return the file name of this entry.

If this entry has no file name (e.g., /), then the full path is returned.

Returns the depth at which this entry was created relative to the root.

The smallest depth is 0 and always corresponds to the path given to the new function on WalkDir. Its direct descendents have depth 1, and their descendents have depth 2, and so on.

Returns the underlying d_ino field in the contained dirent structure.

Trait Implementations

impl Clone for DirEntry
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for DirEntry
[src]

Formats the value using the given formatter.