<< Back


FVSDK_GetCurrentDirectory

Synopsis

FVSDK_ERROR_CODE FVSDK_GetCurrentDirectory(FVSDK_Session* pSession, LPSTR pszBuffer, int nBufferSize);

Description

Sends the PWD (print working directory) FTP command to the server to retrieve the current directory path.

Parameters

pSession

A pointer to the FVSDK_Session that is to perform the operation.

pszBuffer

A pointer to a buffer that will receive the null terminated string containing the current directory path. pszBuffer will be filled with the current path up to the length of (nBufferSize - 1). This function will always ensure pszBuffer is a NULL terminated string.

nBufferSize

The size of pszBuffer in bytes.

Return Value

FVSDK_OK if the current directory name was successfully retrieved. Error codes can be found in FVSDK_ErrorCodes.h.

Example

// buffer to receive the current directory
char pszBuffer[MAX_PATH * 2];

// get the current directory
if (FVSDK_GetCurrentDirectory(pSession, pszBuffer, sizeof(pszBuffer)) != FVSDK_OK)
    AfxMessageBox("Unable to get the current directory from the server.");