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.
sDirectory = CSplitpath:GetDir() where |
|
|
sDirectory is a string containing the directory name. On failure, nil is returned.
Suppose a file exists with a full path named sPath. The following script retrieves the directory component:
|
-- create a CSplitpath object for path sPath |
|
-- returns the directory component |