]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scripting/NasalSGPath.cxx
Remove debug console output in FGApproachController
[flightgear.git] / src / Scripting / NasalSGPath.cxx
index 3008a4965c0cf610760aa451a2c6b69342a26e14..19a74aff2a0d6c0952498c5dab72ee8e10c7c9e7 100644 (file)
@@ -60,6 +60,12 @@ static naRef f_new_path(const nasal::CallContext& ctx)
   return validatedPathToNasal(ctx, SGPath(ctx.getArg<std::string>(0)));
 }
 
+static int f_path_create_dir(SGPath& p, const nasal::CallContext& ctx)
+{
+  // limit setable access rights for Nasal
+  return p.create_dir(ctx.getArg<mode_t>(0, 0755) & 0775);
+}
+
 /**
  * os.path.desktop()
  */
@@ -126,10 +132,10 @@ naRef initNasalSGPath(naRef globals, naContext c)
     .method("isAbsolute", &SGPath::isAbsolute)
     .method("isNull", &SGPath::isNull)
 
-    .method("create_dir", &SGPath::create_dir)
+    .method("create_dir", &f_path_create_dir)
     .method("remove", &SGPath::remove)
     .method("rename", &SGPath::rename);
+
   nasal::Hash globals_module(globals, c),
               path = globals_module.createHash("os")
                                    .createHash("path");