Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
LInetFtp::GetCurrentDir
#include "ltwrappr.h"
L_INT LInetFtp::GetCurrentDir(pszDirectory, ulSize = MAX_PATH)
L_TCHAR *pszDirectory; |
/* character string to be updated */ |
L_UINT32 ulSize; |
/* length, in characters, of the buffer for the current directory string */ |
Retrieves the current directory for the FTP connection.
Parameter |
Description |
pszDirectory |
Character string to be updated with the current directory string, which specifies the absolute path to the current directory. The string is NULL-terminated. This parameter cannot be NULL. |
ulSize |
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. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
Retrieves the current directory.
If the pszDirectory parameter is NULL, this function will fail.
Required DLLs and Libraries
LTFIL For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
LInetFtp::CreateDir, LInetFtp::DeleteDir, LInetFtp::BrowseDir, LInetFtp::ChangeDir, Class Members |
Topics: |
|
|
Example
This example gets the current remote directory from an FTP server.
L_INT LInetFtp_GetCurrentDirExample(HWND hWndParent) { L_INT nRet; L_TCHAR szRemoteDir[MAX_PATH]; LInetFtp InetFtp(TEXT("www.leadtools.com")); // Checking if the connection failed nRet = InetFtp.GetErrorFromList (); if(nRet != SUCCESS) { InetFtp.DisplayError (hWndParent, TEXT("Can't connect to the FTP server")); return nRet; } nRet = InetFtp.GetCurrentDir(szRemoteDir); if(nRet != SUCCESS) { InetFtp.DisplayError(hWndParent, TEXT("Can't get a remote directory name, an error within the server")); return nRet; } return SUCCESS; }