LInetFtp::GetCurrentDir

#include "ltwrappr.h"

L_INT LInetFtp::GetCurrentDir(pszDirectory, ulSize = MAX_PATH)

L_TCHAR L_FAR *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
LTWEB

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:

FTP Functions: Remote Directory Operations

 

How to Program with the LInetFtp Class

Example

// This example gets the current remote directory from an FTP server

L_VOID TestFunction(HWND hWndParent)
{
   L_TCHAR szRemoteDir[MAX_PATH];

   LInetFtp InetFtp(TEXT("www.leadtools.com"));

   // Checking if the connection failed
   if(InetFtp.GetErrorFromList () != SUCCESS)
   {
      InetFtp.DisplayError (hWndParent, TEXT("Can't connect to the FTP server"));
      return;
   }

   if(InetFtp.GetCurrentDir(szRemoteDir) != SUCCESS)
   {
      InetFtp.DisplayError(hWndParent, TEXT("Can't get a remote directory name, an error within the server"));
      return;
   }
}