Gentee Programming Language > Documentation > Libraries Download documentation

File search

An object of the ffind type is used to search for files and directories by mask. Before starting the search, you should call the init method.
 
ffind.init(
      str   name,
      uint   flag
)

Parameters

nameThe mask for searching files and directories.
flagThe combination of the following flags:
$FIND_DIRSearch only for directories
$FIND_FILESearch only for files
$FIND_RECURSESearch subdirectories

After this it is possible to use the initiated object in the foreach loop. The finfo structure will be returned for each found file.

ffind fd
fd.init( "c:\\*.exe", $FIND_FILE | $FIND_RECURSE )
foreach finfo cur,fd
{
   print( "\( cur.fullname )\n" )
}

See also

    Function working with files     The structure finfo


 Copyright © 2004-2006 Gentee Inc. All rights reserved.