CSplitpath:GetFilename


The GetFilename method returns the filename from a CSplitpath object. The filename includes no directory or file extension.

Syntax

sFileName = CSplitpath:GetFilename()

where

    sFileName is a string containing the file name. On failure, nil is returned.

Example

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

S = CSplitpath:new( sPath )

-- create a CSplitpath object for path sPath

sFileName = S:GetFilename()

-- returns the file name

Related Topics

CSplitpath class