CSplitpath:Merge


The Merge method combines all of the components of the CSplitpath object into a single path. Use this to assemble a full path name afer components have been changed.

Syntax

sString = CSplitpath:Merge()

where

 

    sFolder is a string containing the full specification of the merged file name. On failure, nil is returned.

Example

Suppose a file exists with a full path named sPath. The script below changed the file name and extension to the string sNewName and merges the components back into a full path:

S = CSplitpath:new( sPath )

-- create a CSplitpath object for path sPath

S:SetFilenameExt( sNewName )

-- change the file name and extension

sNewPath = S:Merge()

-- merge components into a new path, sNewPath

Related Topics

Split

CSplitpath class