aftp_set_data_type

The aftp_set_data_type call sets the data type for file transfers. A connection to the AFTP server is not required before using this call. The data type can be changed at any time.

AFTP_ENTRY aftp_set_data_type(
IN AFTP_HANDLE_TYPE
connection_id,
IN AFTP_DATA_TYPE_TYPE
data_type,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
data_type
The data type to be used for subsequent data transfers.
AFTP_ASCII
Transfer files as text files in ASCII.
AFTP_BINARY
Transfer files as a binary sequence of bytes without translation.
AFTP_DEFAULT_DATA_TYPE
Use the data transfer type set in the .INI file. If no type is set in the .INI file, use AFTP_ASCII.

This is the default setting.

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;

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

    /*
     * Set the data type for AFTP file
     * transfers.
     */

    aftp_set_data_type(
        connection_id,
        AFTP_BINARY,
        &aftp_rc);

    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error setting AFTP data type.\n");
    }

}
 

Line Flows

None.