Update io.h

This commit is contained in:
blueloveTH 2023-03-18 11:02:04 +08:00
parent 596d4b9c44
commit 533e13437e

View File

@ -122,6 +122,12 @@ void add_module_os(VM* vm){
}
return VAR(path.string());
});
vm->bind_func<1>(mod, "path_exists", [](VM* vm, const Args& args){
std::filesystem::path path(CAST(Str&, args[0]).c_str());
bool exists = std::filesystem::exists(path);
return VAR(exists);
});
}
} // namespace pkpy