findClose

Syntax

int findClose(int *searchHandle)

Arguments

searchHandle
A search handle from a previous call to findFirstFile / findNextFile.

Return

Returns 0 if the function failed, or non-zero if the function succeeded.

Description

Closes a file search handle opened with findFirstFile.

Comment

Internally, findClose is a simple wrapper around the built-in Windows [Win32 FindClose API] function.

Example

%ffp

OnFilterStart: {

  int Handle, Attribute;

  // Search for 8bf files in the filterInstallDir
  snprintf(str1, 255, "%s\\*.8bf", filterInstallDir);	

  // Optionally, search the C: root instead
  //strcpy(str1,"C:\\");

  Handle = findFirstFile (str1, str9, &Attribute);
  if (Attribute != FILE_ATTRIBUTE_DIRECTORY) 
    Info ("%s - %d",str9, Attribute);
     
  if (Handle != INVALID_HANDLE_VALUE){
    while (findNextFile(Handle, str9, &Attribute) != 0) { 
      if (Attribute != FILE_ATTRIBUTE_DIRECTORY) 
        Info ("%s - %d",str9, Attribute);
    }
  }

  findClose(Handle);

  return false;
}

See Also

findFirstFile, findNextFile