User Tools

Site Tools


CombinePath(path1, path2)

Category: File function (found in the "Special" category in the EasyMorph application)


This function combines two paths into one, intelligently dealing with backslashes and relative paths.

Use cases

This function is convenient in projects executed on EasyMorph Server. In these cases, the root folder can be defined as a task parameter and the actual path calculated using combinepath.


path1Text A folder path. Absolute or relative.
path2Text A relative file or folder path.

Return value type: Text.


If both arguments contain relative paths, then the resulting path will be converted into an absolute path in the current directory.


combinepath( 'C:\data', 'file.txt' )  //Returns 'C:\data\file.txt'
combinepath( 'C:\data', '..\file.txt' )  //Returns 'C:\file.txt'
combinepath( 'C:\myfiles', 'mydocs\myprojects' )  //Returns 'C:\myfiles\mydocs\myprojects'

See also

syntax/functions/combinepath.txt · Last modified: 2021/09/08 14:34 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki