|
|
@@ -226,6 +226,23 @@ void add_module_os(VM* vm){
|
|
|
std::filesystem::path path(CAST(Str&, args[0]).sv());
|
|
|
return VAR(path.filename().string());
|
|
|
});
|
|
|
+
|
|
|
+ vm->bind_func<1>(path_obj, "isdir", [](VM* vm, ArgsView args){
|
|
|
+ std::filesystem::path path(CAST(Str&, args[0]).sv());
|
|
|
+ bool isdir = std::filesystem::is_directory(path);
|
|
|
+ return VAR(isdir);
|
|
|
+ });
|
|
|
+
|
|
|
+ vm->bind_func<1>(path_obj, "isfile", [](VM* vm, ArgsView args){
|
|
|
+ std::filesystem::path path(CAST(Str&, args[0]).sv());
|
|
|
+ bool isfile = std::filesystem::is_regular_file(path);
|
|
|
+ return VAR(isfile);
|
|
|
+ });
|
|
|
+
|
|
|
+ vm->bind_func<1>(path_obj, "abspath", [](VM* vm, ArgsView args){
|
|
|
+ std::filesystem::path path(CAST(Str&, args[0]).sv());
|
|
|
+ return VAR(std::filesystem::absolute(path).string());
|
|
|
+ });
|
|
|
}
|
|
|
#else
|
|
|
|