CFindFiles:Start


The Start method re-initializes the file name iteration after files were already iterated. You can then use the Next method to retrieve each file name. As an alternative to iteration using Start and Next, you can use the GetTable method to return the names of all file names in a Lua table.

Syntax

CFindFiles:Start()

  

This method re-initializes the file name iteration after files have been found and after the names have been iterated. Normally, iteration is ready for the Next method after the Open method is called. See the Next method for more information.

Example

The following script makes a second pass through the file name list by re-starting the iteration using the Start method:

F = CFindFiles:new()

-- Create a new CFindFiles object

F:Open( sFolder, "h*.fts" )

-- specify thefolder and template

while F:Next() do

-- Iterate through the file names

  Printf("%s\r\n", F:GetPath() )

-- list each path name

end

 

-- do something with the file names

 

F:Start()

-- Re-initialize the iteration

while F:Next() do

-- Iterate through the files again

  Printf("%s\r\n", F:GetPath() )

-- list the current path name

end

 

 

 

F:Close()

-- finished with this object

Related Topics

Open

Next

CFindFiles class