FindFileClose

Searches for the next file matching the filemask specified by the FindFirstFile method. There is no need to call this if call to FindFirstFile() failed.

Syntax

FindFileClose

Returns

No data returned.

Example

An example of FindFileClose function in the FTPA protocol used to transfer files between network computers. Object. Searches for a certain file until found in the root:

Function Main

Dim FTPobj as Object

Const DIRECTORYMASK=&H10

ip = "127.0.0.1"

port = 21

cr = Chr(13) + Chr(10)

Set FTPobj = FTP.Connect (ip,port,TRUE,"anonymous","lnss@gfi.com")

Found=FTPobj.FindFirstFile("*")

While Found

If (FTPobj.GetFindFileAttributes And DIRECTORYMASK) = DIRECTORYMASK Then

FileType="directory"

Found=FTPobj.FindNextFile

Else

FileType="file"

if FTPobj.GetFindFileName = "test.zip" then

echo "test.zip exists" & cr

FTPobj.FindFileClose

Found = false

else

echo "test.zip does not exist" & cr

Found=FTPobj.FindNextFile

End If

End If

Wend

End Function