GopherFindFirstFileGopherFindFirstFile*
*Contents  *Index  *Topic Contents
*Previous Topic: GopherCreateLocator
*Next Topic: GopherGetAttribute

GopherFindFirstFile

HINTERNET GopherFindFirstFile(
    IN HINTERNET hGopherSession,
    IN LPCSTR lpszLocator,
    IN LPCSTR lpszSearchString,
    OUT LPGOPHER_FIND_DATA lpFindData,
    IN DWORD dwFlags,
    IN DWORD dwContext
);

Uses a Gopher locator and some search criteria to create a session with the server and locate the requested documents, binary files, index servers, or directory trees.

hGopherSession
Handle to a Gopher session returned by InternetConnect.
lpszLocator
Name of the item to locate. Can be one of the following items:
  • Gopher locator returned by a previous call to this function or the InternetFindNextFile function.
  • NULL pointer or zero-length string indicating that the topmost information from a Gopher server is being returned.
  • Locator created by the GopherCreateLocator function.
lpszSearchString
Address of a buffer that contains the strings to search, if this request is to an index server. Otherwise, this parameter should be NULL.
lpFindData
Address of a GOPHER_FIND_DATA structure that receives the information retrieved by this function.
dwFlags
Action flag that can be a combination of the following values:
INTERNET_FLAG_DONT_CACHE
Does not add the returned entity to the cache. Identical to the preferred value, INTERNET_FLAG_NO_CACHE_WRITE.
INTERNET_FLAG_HYPERLINK
Forces a reload if there was no Expires time and no Last-Modified time returned from the server when determining whether to reload the item from the network.
INTERNET_FLAG_MAKE_PERSISTENT
No longer supported.
INTERNET_FLAG_MUST_CACHE_REQUEST
Causes a temporary file to be created if the file cannot be cached. Identical to the preferred value, INTERNET_FLAG_NEED_FILE.
INTERNET_FLAG_NEED_FILE
Causes a temporary file to be created if the file cannot be cached.
INTERNET_FLAG_NO_CACHE_WRITE
Does not add the returned entity to the cache.
INTERNET_FLAG_RELOAD
Forces a download of the requested file, object, or directory listing from the origin server, not from the cache.
INTERNET_FLAG_RESYNCHRONIZE
Reloads the FTP resource.
dwContext
Application-defined value that associates this search with any application data.

GopherFindFirstFile closely resembles the Win32 FindFirstFile function. It creates a connection with a Gopher server, and then returns a single structure containing information about the first Gopher object referenced by the locator string.

After calling GopherFindFirstFile to retrieve the first Gopher object in an enumeration, an application can use the InternetFindNextFile function to retrieve subsequent Gopher objects.

Use the InternetCloseHandle function to close the handle returned from GopherFindFirstFile. If there are any pending operations described by the handle when the application calls InternetCloseHandle, they are canceled or marked as closed pending. Any open sessions are terminated, and any data waiting for the caller is discarded. In addition, any allocated buffers are freed.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.