Function async_fs::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.


An error will be returned in the following situations:

  • path does not point to an existing file or directory.
  • A non-final component in path is not a directory.
  • Some other I/O error occurred.


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