Click to return to the Networking, Protocols     
FtpFindFirstFile Function     FtpGetFile Function     FTP Functions    
Web Workshop  |  Networking, Protocols & Data Formats

FtpGetCurrentDirectory Function


Retrieves the current directory for the specified FTP session.

Syntax

BOOL FtpGetCurrentDirectory(
    IN HINTERNET hConnect,
    OUT LPTSTR lpszCurrentDirectory,
    IN OUT LPDWORD lpdwCurrentDirectory
);

The actual syntax of this function varies between its ANSI and Unicode implementations. For more information, see Win32 Internet Functions Syntax.

Parameters

hConnect
Valid handle to an FTP session.
lpszCurrentDirectory
Address of a buffer that receives the current directory string, which specifies the absolute path to the current directory. The string is null-terminated.
lpdwCurrentDirectory
Address of a variable that specifies the length, in characters, of the buffer for the current directory string. 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 receives the number of characters copied into the buffer.

Return Value

Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.

Remarks

If the lpszCurrentDirectory buffer is not large enough, lpdwCurrentDirectory receives the number of bytes required to retrieve the full, current directory name.

Function Information

Windows NT Use version 4.0. Implemented as ANSI and Unicode functions.
Windows Use Windows 95 and later. Implemented as ANSI and Unicode functions.
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 3.0 (ANSI only), 5 (ANSI and Unicode)

Windows CE

Windows CE Use version 2.12 and later. Implemented as ANSI and Unicode functions.
Minimum availability Internet Explorer 4.0

See Also

Microsoft Win32 Internet Functions Overview, FTP Sessions, Microsoft Win32 Internet Functions Reference, FTP Functions, FtpSetCurrentDirectory



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.