mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
Update io.h
This commit is contained in:
parent
596d4b9c44
commit
533e13437e
6
src/io.h
6
src/io.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user