Function zng_task::fs::metadata

pub async fn metadata<P>(path: P) -> Result<Metadata, Error>
where P: AsRef<Path>,
Expand description

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.

§Errors

An error will be returned in the following situations:

  • path does not point to an existing file or directory.
  • The current process lacks permissions to read metadata for the path.
  • Some other I/O error occurred.

§Examples

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