Nasal library/os.path: Difference between revisions

m
(Start realpath doc)
m (→‎realpath: finish)
Line 169: Line 169:
{{Nasal doc
{{Nasal doc
|syntax = os.path.realpath;
|syntax = os.path.realpath;
|text = A variable that is a string and gives the full file path. This should only be used when the path is an absolute path.
|text = A variable that is a string and gives the full file path. This should only be used when the path is an absolute path. If the path is relative, it will simply be appended to the FlightGear folder (the level up from [[$FG_ROOT]]).
|example1 = var path = os.path.new(getprop("/sim/fg-home"));
|example1 = var path = os.path.new(getprop("/sim/fg-home"));
print(path.realpath); # prints the absolute path of $FG_HOME
print(path.realpath); # prints the absolute path of $FG_HOME
}}
}}
==== file ====
==== file ====
==== dir ====
==== dir ====