[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'FileUtil' (#lcl)

# TFileSearcher.Search

Searches for files in specified path with passed options.

## Declaration

Source position: fileutil.pas line 164

`public procedure TFileSearcher.Search(`
`const ASearchPath: String;`
`ASearchMask: String = '''''';`
`ASearchSubDirs: Boolean = true;`
`AMaskSeparator: Char = ''';'''`
`);`

## Arguments

`ASearchPath` |  | Base path for searching files.
`ASearchMask` |  | Mask which file should match.
`ASearchSubDirs` |  | If search recursively sub directories.

## Description

Searches for files in specified path. When file is found the OnFileFound event is invoked, for directories OnDirectoryFound event. You can abort searching process by calling Stop method in this events.

## See also

TFileSearcher.OnFileFound |  | Is invoked when file is found.
TFileSearcher.OnDirectoryFound |  | Is invoked when directory is found.
TFileIterator.Stop |  | Stops the searching process.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.