Skip to content
mba105 edited this page Sep 24, 2014 · 2 revisions

Home > [Scripting Reference](Scripting Reference) > path.join


path.join

The path.join function joins two path portions together into a single path.

#!lua
path.join("leading", "trailing")

If trailing is an absolute path, then the leading portion is ignored, and the absolute path is returned instead (see below for examples).

Parameters

leading is the beginning portion of the path; trailing is the ending portion.

Return Value

A merged path.

Examples

#!lua
-- returns "MySolution/MyProject"
p = path.join("MySolution", "MyProject")
 
-- returns "/usr/bin", because the trailing path is absolute
p = path.join("MySolution", "/usr/bin")
 
-- tokens are assumed to be absolute; this returns "$(ProjectDir)"
p = path.join("MySolution", "$(ProjectDir)")
Clone this wiki locally