2019-08-04 11:24:30 -07:00
|
|
|
use super::asyncify;
|
2019-07-19 13:11:46 -07:00
|
|
|
|
2019-08-04 11:24:30 -07:00
|
|
|
use std::fs::Metadata;
|
2018-08-01 06:39:27 +02:00
|
|
|
use std::io;
|
|
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
|
|
/// Queries the file system metadata for a path.
|
|
|
|
|
///
|
|
|
|
|
/// This is an async version of [`std::fs::symlink_metadata`][std]
|
|
|
|
|
///
|
|
|
|
|
/// [std]: https://doc.rust-lang.org/std/fs/fn.symlink_metadata.html
|
2019-08-04 11:24:30 -07:00
|
|
|
pub async fn symlink_metadata<P>(path: P) -> io::Result<Metadata>
|
2018-08-01 06:39:27 +02:00
|
|
|
where
|
|
|
|
|
P: AsRef<Path> + Send + 'static,
|
|
|
|
|
{
|
2019-08-04 11:24:30 -07:00
|
|
|
asyncify(|| std::fs::symlink_metadata(&path)).await
|
2018-08-01 06:39:27 +02:00
|
|
|
}
|