aftp_extract_write_mode

The aftp_extract_write_mode call extracts the way that existing files are treated when a data transfer writes to them. If the aftp_set_write_mode call has not been invoked, the AFTP default write mode value is returned.

AFTP_ENTRY aftp_extract_write_mode(
IN AFTP_HANDLE_TYPE
connection_id,
OUT AFTP_WRITE_MODE_TYPE AFTP_PTR
write_mode,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
write_mode
The method used to write a file if a copy of the file already exists. If the file does not exist on the target, a new file is created.
AFTP_REPLACE
Transferred file replaces the existing file.
AFTP_APPEND
Transferred file is appended to the existing file.
return_code
The return code issued for this function. See AFTP Return Codes for the list of possible return codes.

Example

{
    AFTP_HANDLE_TYPE       connection_id;
    AFTP_RETURN_CODE_TYPE  aftp_rc;
    AFTP_WRITE_MODE_TYPE   write_mode;

    /*
     * Before issuing the example call, you must have:
     *    a connection_id, use:  aftp_create()
     */

    /*
     * Extract the file write mode for AFTP.
     */

    aftp_extract_write_mode(
        connection_id,
        &write_mode,
        &aftp_rc);
    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error extracting AFTP write mode.\n");
    }
}
 

Line Flows

None.