Nasal library/os.path: Difference between revisions

Doc append()
m (→‎set(): Fix minor error in example 2)
(Doc append())
Line 46: Line 46:


==== append() ====
==== append() ====
{{Nasal doc
|syntax = os.path.append([path]);
|text = Appends a new part to the filepath.
|param1 = path
|param1text = Optional string specifying the filepath. If not given, the resultant path will not change.
|example1 = var path = os.path.new("C:/Windows");
# var path = os.path.new("/usr/"); # alternative Unix filepath
print(path.realpath);
path.append();
print(path.realpath); # the path will not change
|example2 = var path = os.path.new("C:/Windows");
# var path = os.path.new("/usr/"); # alternative Unix filepath
print(path.realpath);
path.append("Program Files");
# path.set("bin"); # alternative Unix filepath
print(path.realpath); # prints "C:/Windows/Program Files" or "/usr/bin"
}}
==== concat() ====
==== concat() ====
==== exists() ====
==== exists() ====