Function async_std::fs::metadata[][src]

pub async fn metadata<P: AsRef<Path>>(path: P) -> Result<Metadata>

Reads metadata for a path.

This function will traverse symbolic links to read metadata for the target file or directory. If you want to read metadata without following symbolic links, use symlink_metadata instead.

This function is an async version of std::fs::metadata.

Errors

An error will be returned in the following situations:

Examples

use async_std::fs;

let perm = fs::metadata("a.txt").await?.permissions();