Unit 'msefileutils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#msegui]

searchfile

Returns the root path if the file exists, or an empty string otherwise

Declaration

Source position: msefileutils.pas line 216

function searchfile(

  const filename: filenamety;

  dir: Boolean = False;

  const aoptions: dirstreamoptionsty = []

):filenamety; overload;

function searchfile(

  const afilename: filenamety;

  const adirnames: array of filenamety;

  const ainclude: fileattributesty = [fa_all];

  const aexclude: fileattributesty = [];

  const aoptions: dirstreamoptionsty = []

):filenamety; overload;

function searchfile(

  const afilename: filenamety;

  const adirname: filenamety;

  const ainclude: fileattributesty = [fa_all];

  const aexclude: fileattributesty = [];

  const aoptions: dirstreamoptionsty = []

):filenamety; overload;

Description

Returns the root path if the file exists, or an empty string otherwise.

Returns the directory of the last occurrence of afilename found in adirnames, or an empty string if none. afilename can be a path and can contain the wildcards ? and *; adirnames can contain ?, *, ** (1 to x directory levels) and *** (0 to x directory levels).

Returns the directory, or an empty string if none. afilename must be a simple filename and can contain the wildcards ? and *; adirname can contain ?, *, ** and ***, as in searchfile.


Documentation generated on: 2026-10-03