CSplitpath:GetFolder2 CSplitpath:Merge

CSplitpath:GetName


The GetName method returns the file name from a CSplitpath object. The name does not include the directory or file extension.

Syntax

sName = CSplitpath:GetName()

 

    On success, this method returns a string containing the file name.

    On failure, this method returns nil.

Example

Suppose a file exists with a full path named sPath. The following script fragment retrieves the folder component:

 

S = CSplitpath:new()

-- create a CSplitpath object

S:SetPath(sPath)

-- Specify the path to be split

sName = S:GetName()

-- assigns the file name component to sName

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath