2,732
edits
Red Leader (talk | contribs) m (→set(): Fix minor error in example 2) |
Red Leader (talk | contribs) (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() ==== |