• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use crate::fs::asyncify;
2 
3 use std::io;
4 use std::path::{Path, PathBuf};
5 
6 /// Reads a symbolic link, returning the file that the link points to.
7 ///
8 /// This is an async version of [`std::fs::read_link`][std]
9 ///
10 /// [std]: std::fs::read_link
read_link(path: impl AsRef<Path>) -> io::Result<PathBuf>11 pub async fn read_link(path: impl AsRef<Path>) -> io::Result<PathBuf> {
12     let path = path.as_ref().to_owned();
13     asyncify(move || std::fs::read_link(path)).await
14 }
15