Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function retrieves the current directory for the specified FTP session.

Syntax

BOOL WINAPI FtpGetCurrentDirectory(
  HINTERNET 
hConnect, 
  LPCTSTR 
lpszCurrentDirectory, 
  LPDWORD 
lpdwCurrentDirectory
);

Parameters

hConnect

[in] Valid handle to an FTP session.

lpszCurrentDirectory

[out] Long pointer to a buffer that receives the null-terminated string that contains the absolute path to the current directory.

lpdwCurrentDirectory

[in, out] Long pointer to a variable that specifies the buffer length, in characters, for the current directory string. On input, the buffer length must include room for a terminating null character. Using a length of MAX_PATH is sufficient for all paths. When the function returns, the variable contains the number of characters that were copied into the buffer.

Return Value

TRUE indicates success. FALSE indicates failure. To get extended error data, call GetLastError.

Remarks

If the lpszCurrentDirectorybuffer is not large enough, lpdwCurrentDirectoryreceives the number of bytes required to retrieve the full, current directory name.

Requirements

Header wininet.h
Library wininet.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

WinInet Functions