blueloveTH il y a 3 ans
Parent
commit
7b27c67544
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      src/io.h

+ 8 - 0
src/io.h

@@ -114,6 +114,14 @@ void add_module_os(VM* vm){
         if(!ok) vm->IOError("operation failed");
         return vm->None;
     });
+
+    vm->bind_func<-1>(mod, "path_join", [](VM* vm, const Args& args){
+        std::filesystem::path path;
+        for(int i=0; i<args.size(); i++){
+            path /= CAST(Str&, args[i]).c_str();
+        }
+        return VAR(path.string());
+    });
 }
 
 } // namespace pkpy