Contents Index Topic Contents | ||
Previous Topic: GopherGetLocatorType Next Topic: HTTP Functions |
GopherOpenFile
HINTERNET GopherOpenFile( IN HINTERNET hGopherSession, IN LPCSTR lpszLocator, IN LPCSTR lpszView, IN DWORD dwFlags, IN DWORD dwContext );Begins reading a Gopher data file from a Gopher server.
- Returns a handle if successful, or NULL if the file cannot be opened. To get extended error information, call GetLastError or InternetGetLastResponseInfo.
- hGopherSession
- Handle to a Gopher session returned by InternetConnect.
- lpszLocator
- Address of a string that identifies the file to open. Generally, this locator is returned from a call to GopherFindFirstFile or InternetFindNextFile. Because the Gopher protocol has no concept of a current directory, the locator is always fully qualified.
- lpszView
- Address of a string that describes the view to open if several views of the file exist at the server. If lpszView is NULL, the function uses the default file view.
- dwFlags
- Conditions under which subsequent transfers occur. Can be any 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
- Causes the Gopher resource to be reloaded from the server.
- dwContext
- Application-defined value that associates this operation with any application data.
GopherOpenFile opens a file at a Gopher server. Because a file cannot actually be opened or locked at a server, this function simply associates location information with a handle that an application can use for file-based operations such as InternetReadFile or GopherGetAttribute.
Use the InternetCloseHandle function to close the handle returned from GopherOpenFile. 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.
See also InternetOpenUrl
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.