tokio-fs-ext 0.0.3

Extend tokio fs to be compatible with native and wasm
Documentation
1
2
3
4
5
6
7
use std::io;

use crate::fs::opfs::{open_dir, open_file};

pub async fn try_exists(path: impl AsRef<std::path::Path>) -> io::Result<bool> {
    Ok(open_file(&path, false, false).await.is_ok() || open_dir(path, false, true).await.is_ok())
}