Older Newer
Mon, 16 Dec 2019 03:11:26 . . . . SyneRyder [Initial function definition]


Changes by last author:

Added:
= 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 ==

<code>

%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;

}

</code>

== See Also ==

findFirstFile, findNextFile