Nasal library/os.path: Difference between revisions

Complete create_dir() doc
(→‎create_dir(): Document the method)
(Complete create_dir() doc)
Line 135: Line 135:
{{Nasal doc
{{Nasal doc
|syntax = os.path.create_dir();
|syntax = os.path.create_dir();
|text = Create the parent of the path as a directory. This will only work if the path is absolute and considered as writable by [https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Main/util.cxx#l142 fgValidatePath()] (typically okay under [[$FG_HOME]]/Export).
|text = Creates the parent of the path as a directory. This will only work if the path is absolute and considered as writable by {{func link|fgValidatePath()|link=https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Main/util.cxx#l142}} (typically okay under [[$FG_HOME]]/Export).
|example1 = var p = os.path.new("/dir/to/create/dummy");
|example1 = var path = os.path.new(getprop("/sim/fg-home") ~ "/Export/test/demo.txt");
p.create_dir(); # This creates the directory /dir/to/create
path.create_dir(); # Creates $FG_HOME/Export/test/
}}
}}