Home |
Function RTFFindFirstEx |
Function RTFFindFirstExRTFFindFirstEx searches a directory for a file satisfying certain criteria: RTFHANDLE RTFFindFirstEx(const char * NamePattern, BYTE Attr, BYTE AttrMask, RTFDOSDirEntry * FileInfo, char * FileName, UINT MaxLength); ParametersNamePatternPointer to a file name which may contain wildcard characters '*' (match zero or more characters) and/or '?' (match exactly one character), and can optionally be preceded by a path. If a path is present, it must not contain any wildcard characters. For compatibility with MS-DOS, pattern "*.*" is silently converted to "*". To search for file names containing one or more periods, use "?*.*" or "*.?*". AttrSpecifies a set of all file attributes a file must have to match the request. Any combination of the following flags can be specified for parameters Attr and AttrMask:
In addition, parameter Attr supports the pseudo-attribute RTF_FIND_NO_ALIAS. If specified, RTFFindFirstEx and RTFFindNextEx will not attempt to match parameter NamePattern against any alias names a file might have (for example, the short name of a file having a long name). If RTF_FIND_NO_ALIAS is specified, only the primary name of a file is returned. AttrMaskSpecifies the set of attributes which are matched against Attr. Attributes set in Attr are automatically added to AttrMask. Specify attributes which should not be set in AttrMask. Pseudo-attribute RTF_FIND_NO_ALIAS has no effect in AttrMask. FileInfoPointer to an RTFDOSDirEntry structure. If the function succeeds, this structure will be filled with the directory entry of the file found. This parameter may be NULL. FileNamePointer to a string buffer to receive the file name without path if a file is found. MaxLengthSize in bytes of the buffer pointed to by FileName. File names with a length larger than MaxLength-1 will not be found. return valueIf the function succeeds, at least one file satisfies the search criteria. *FileInfo contains the directory entry of the first file and the function return value is greater than or equal to RTF_NO_ERROR. The return value is a file handle which may be passed to subsequent calls to RTFFindNextEx. If the function fails, the return value is a negative error code. In this case, no handle is allocated and RTFFindClose need not be called. Please note that on exFAT and ISO 9660 volumes, no file name is stored in *FileInfo. It is important to close the handle using RTFFindClose when no longer needed. Failing to do so will quickly exhaust the available file handles.
|