CSplitpath:delete CSplitpath:GetDrive

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()

 

 

bullet.gif    On success, this method returns a string containing the directory name.

bullet.gif    On failure, this method returns nil.

Example

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

S = new_splitpath()

-- create a CSplitpath object

S:SetPath(sPath)

-- specify the path to be split

sDir = S:GetDir()

-- assigns the directory component to the string sDir.

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath class, SetDir


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.