CSplitpath:SetName


The SetName method sets the machine name component of the CSplitpath object. Use Merge to combine this component and the other components into a full path.

Syntax

bSuccess = CSplitpath:SetName( sMachineName )

where

 

    sMachineName is the new machine name.

    bSuccess is the returned success code. On success it is true, otherwise false.

Example

Suppose a file exists with a full path named sPath. The following script creates a new path using a different machine name, sNewName:

S = CSplitpath:new(sPath)

-- create a CSplitpath object for path sPath

S:SetName( "MyMachine" )

-- assign a new machine name, "MyMachine"

S:Merge()

-- combine the name into the path

Related Topics

GetName

CSplitpath class