###User Defined Function###
_FO_FileSearch

###Description###
Returns a list of files in the specified directory.

###Syntax###
#Include <FileOperations.au3>
_FO_FileSearch ( $sPath [, $sMask = '*' [, $fInclude=True [, $iDepth=125 [, $iFull=1 [, $iArray=1 [, $iTypeMask=1 [, $sLocale=0[, $vExcludeFolders = ''[, $iExcludeDepth = -1]]]]]]]]] )

###Parameters###
@@ParamTable@@
$sPath
	Search path
$sMask
	[optional] The mask depends on the parameter $TypeMask and can either be complete using the characters "*" and "?" (the default), or using only the file extensions. The character "|" is used as a delimiter. The default is '*', which means the search all files.
$fInclude
	[optional] Include or exclude the specified in a mask
		True - Find in accordance with mask (default)
		False - Find all except specified in a mask
$iDepth
	[optional] The depth of nesting of directories (0 - root directory; the default 125)
$iFull
	[optional] Paths in returned data
		0 - relative
		1 - (by default) Full path
		2 - File names with extension
		3 - File names without extension
$iArray
	[optional] Specifies the output: array or list
		0 - Delimited list @CRLF 
		1 - (by default) Array, where $iArray[0]=number of files
		2 - Array, where $iArray[0] contains the first file
$iTypeMask
	[optional] Mask type
		0 - Auto detection (1 or 2)
		1 - (by default) Force the use of mask type: <b>*.is?|s*.cp*</b>. You can also specify a file name without wildcard characters "*" or "?" and without the extension and will be found.
		2 - Force the use of mask type: <b>tmp|bak|gid</b>. Used only by file extension. The parameter $sLocale is ignored in this case.
$sLocale
	[optional] Case sensitivity.
		-1 - Not case sensitive (only for 'A-z').
		0 - (by default) Not case sensitive, by default. (for any characters)
		1 - Case sensitive (for any characters)
		&lt;&gt; - not case sensitive, specified range of characters from local languages. For example '-'. 'A-z' is not required, they are enabled by default.
$vExcludeFolders
	[optional] Excludes folders from search. List the folder names via the "|", for example, "Name1|Name2|Name3|".
$iExcludeDepth
	[optional] Nesting level for the parameter $vExcludeFolders. -1 by default, which means disabled.
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	Returns a list of files.
Failure:	Returns an empty string and sets @error:
@error:	1 - Invalid path
	2 - Invalid mask
	3 - Not found
@@End@@

###Remarks###
Be sure to check the @error, because in the absence of found files, you cannot use an array. This results in an error that cannot be found in the test.

Use _FO_CorrectMask, to correct the errors that can be tolerated by the user when creating a mask.
You cannot use both types of masks together. If auto detection is turned on ($iTypeMask=0) then if at least one of these three characters "<b>*.?</b>" uses the $iTypeMask=1, otherwise $iTypeMask=2.
In the GUI as a separator in the mask, you can use a different character, such as ";" or "," especially when using $iTypeMask=2, but in the function parameter to replace it with a "|". You can use the <font class="S41">Opt</font><font class="S81">(</font><font class="S71">"GUIDataSeparatorChar"</font><font class="S81">,</font> <font class="S41">Chr</font><font class="S81">(</font><font class="S31">1</font><font class="S81">))</font>, to set a separator for a Combo in the GUI.
Cannot create the directory depth of more than 125. To handle the long path prepend the path \\?\, for example "\\?\D:MyFolder"

###Related###
_FO_CorrectMask, _FO_FolderSearch

###Example###
@@IncludeExample@@