Share this page

# ftp_get_last_error

FTP Functions (ftp)

Retrieves the last error received from the FTP server.

    char *ftp_get_last_error( FTP *ppftp );

Function objFTP.get_last_error( ppfttp as FTP) as String ` for VB Script

ppftp | An FTP session identifier.

The ftp_get_last_error function returns the most recent error that occurred during the FTP session.

## Return Values

This function returns the most recent FTP error code, issued during the current FTP session.

## Parameterization

Standard parameterization is not available for this function.

## Example

In the following example, the ftp_get_last_error function returns the last error.

        #include "mic_ftp.h"
        FTP pFTP;
        char * error = 0;
        long errId = 0;
        pFTP = 0;

        ftp_logon_ex (&pFTP, "FtpLogon", "URL=ftp://ftp.abc.com",
                LAST );

        ftp_dir_ex (&pFTP, "FtpDir", "PATH=pub/test",
                LAST );

        error = ftp_get_last_error (&pFTP);
        errId = ftp_get_last_error_id (&pFTP);
        ftp_logout_ex(&pFTP);

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: