CFindFiles:Open


The Open method specifies the folder name and the filename template for the CFindFiles object.

Syntax

CFindFiles:Open( sFolder )

CFindFiles:Open( sFolder, sTemplate="*.*" )

bullet.gif    sFolder is the name of the folder to be searched.

bullet.gif    sTemplate is a wildcard template for files to be found.

Remarks

Call this method to setup the searching before beginning to iterate using Next. This method can be disregarded if the folder and template are specified in the new constructor. You can also specify different folders or templates using this method repeatedly for the same object, but be sure to call Close after finishing each search procedure, before calling the next Open.

Example

The following script lists files inside the folder specified by the string sFolder and the filename template "h*.fts"

F = new_findfiles()

-- Create a new CFindFiles object

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

-- specify thefolder and template

while F:Next() do

-- Iterate to the next file

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

-- list the current path name

end

 

F:Close()

-- finished with this object

Related Topics

CFindFiles, Next


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