CSplitpath:GetFilenameExt
The GetFilenameExt method returns the filename+extension from a CSplitpath object. The returned string has a form like "filename.ext". If the filename has no extension, it is returned without a terminating period.
sNameExt = CSplitpath:GetFilenameExt() where |
|
sNameExt is a string containing the file name and ectension. On failure, nil is returned.
Suppose a file exists with a full path named sPath. The following script retrieves the filename and extension components:
|
-- create a CSplitpath object for path sPath |
|
-- returns the filename and extension |
|
-- when done with S, remove it from memory |