summaryrefslogtreecommitdiff
path: root/vendor/tokio/src/fs/read_link.rs
blob: f3d5e99f9440fc38a5a7bcb8df2e843b612f39ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use crate::fs::asyncify;

use std::io;
use std::path::{Path, PathBuf};

/// Reads a symbolic link, returning the file that the link points to.
///
/// This is an async version of [`std::fs::read_link`].
pub async fn read_link(path: impl AsRef<Path>) -> io::Result<PathBuf> {
    let path = path.as_ref().to_owned();
    asyncify(move || std::fs::read_link(path)).await
}