CFindFiles:GetPath
The GetPath method returns the filename obtained by the Next method. This method simply accesses the string saved by the last call to Next.
sFileName = CFindFiles:GetPath()
|
This method simply accesses the static string where the file name was stored by the last call to Next. It is useful in iterating through a folder, as shown in the example below.
The following script fragment lists files inside the folder specified by the string sFolder and the filename template "h*.fts". Notice that F:Next() returns nil and terminates the loop before F:GetPath() is called after the last file has been processed.
|
-- Create a new CFindFiles object |
|
-- specify thefolder and template |
|
-- Iterate to the next file |
|
-- list the current path name |
|
|
|
-- finished with this object |