canonicalize in async_std::fs - Rust (original) (raw)

Function canonicalize

Source

pub async fn canonicalize<P: AsRef<Path>>(path: P) -> Result<PathBuf>

Expand description

Returns the canonical form of a path.

The returned path is in absolute form with all intermediate components normalized and symbolic links resolved.

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

§Errors

An error will be returned in the following situations:

§Examples

use async_std::fs;

let path = fs::canonicalize(".").await?;