1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
use crate::asyncify;

use std::fs::Metadata;
use std::io;
use std::path::Path;

/// Queries the file system metadata for a path.
pub async fn metadata<P>(path: P) -> io::Result<Metadata>
where
    P: AsRef<Path> + Send + 'static,
{
    asyncify(|| std::fs::metadata(&path)).await
}