MCPcopy Create free account
hub / github.com/PerroEngine/Perro / exists

Function exists

perro_source/api_modules/perro_modules/src/file.rs:37–50  ·  view source on GitHub ↗
(path: P)

Source from the content-addressed store, hash-verified

35}
36
37pub fn exists<P: ResPathSource>(path: P) -> bool {
38 let path = path.as_res_path_str();
39 if validate_virtual_asset_path(path).is_err() {
40 return false;
41 }
42 match perro_io::resolve_path(path) {
43 perro_io::ResolvedPath::Excluded(_) => false,
44 perro_io::ResolvedPath::Disk(pb) => pb.exists(),
45 perro_io::ResolvedPath::WebUserStorage(_)
46 | perro_io::ResolvedPath::PerroAssets(_)
47 | perro_io::ResolvedPath::StaticBinary(_)
48 | perro_io::ResolvedPath::DlcStaticBinary { .. }
49 | perro_io::ResolvedPath::DlcPerroAssets { .. } => load_asset(path).is_ok(),
50 }
51}
52
53pub fn is_dir<P: ResPathSource>(path: P) -> bool {

Callers

nothing calls this directly

Calls 4

load_assetFunction · 0.85
as_res_path_strMethod · 0.80
resolve_pathFunction · 0.50

Tested by

no test coverage detected