CSplitpath:GetFilenameExt CSplitpath:GetFolder2

CSplitpath:GetFolder


The GetFolder method returns the folder name from a CSplitpath object. The returned string includes the machine name, drive name, and directory. The string is terminated by a backslash character, \.To return the folder without a terminal backslash, use GetFolder2() instead.

Syntax

sFolder = CSplitpath:GetFolder()

 

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

bullet.gif    On failure, this method returns nil.

Example

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

S = new_splitpath()

-- create a CSplitpath object

S:SetPath(sPath)

-- Specify the path to be split

sFolder = S:GetFolder()

-- assigns the folder component to the string sFolder

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath class

GetFolder2


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