CSplitpath:GetDir


The GetDir method returns the directory name from a CSplitpath object. The directory name does not include the machine name, drive name, file name, or extension.

Syntax

sDirectory = CSplitpath:GetDir()

where

 

 

    sDirectory is a string containing the directory name. On failure, nil is returned.

Example

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

S = CSplitpath:new( sPath )

-- create a CSplitpath object for path sPath

sDir = S:GetDir()

-- returns the directory component

Related Topics

SetDir

CSplitpath class