aftp_get_write_mode_string

The aftp_get_write_mode_string call gets a string that corresponds to the input AFTP write mode value. This string is available to allow all users of the AFTP API to have consistent strings for each write mode type. It is not necessary to create an AFTP connection object before issuing this call.

AFTP_ENTRY aftp_get_write_mode_string(
IN AFTP_WRITE_MODE_TYPE
write_mode,
OUT unsigned char AFTP_PTR
write_mode_string,
IN AFTP_LENGTH_TYPE
write_mode_size,
OUT AFTP_LENGTH_TYPE AFTP_PTR
returned_length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

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 will be created.
AFTP_REPLACE
Transferred file will replace the existing file.
AFTP_APPEND
Transferred file will be appended to the existing file.
write_mode_string
The buffer into which the write mode string will be written.

Use the AFTP_WRITE_MODE_SIZE constant to define the length of this buffer. Add 1 to the size if you want to be able to add a null terminator to the text in the buffer.

write_mode_size
The size of the buffer into which the write mode string will be written.
returned_length
The actual length of the write_mode_string parameter in bytes.
return_code
The return code issued for this function. See AFTP Return Codes for the list of possible return codes.

Example

{
    AFTP_RETURN_CODE_TYPE         aftp_rc;
    unsigned char                 write_mode[AFTP_WRITE_MODE_SIZE+1];
    AFTP_LENGTH_TYPE              returned_length;

    /*
     * There are no prerequisite calls for this call.
     */

    /*
     * Get the write mode string.
     */

    aftp_get_write_mode_string(
        AFTP_REPLACE,
        write_mode
        (AFTP_LENGTH_TYPE)sizeof(write_mode)-1,
        &returned_length,
        &aftp_rc);
}
 

Line Flows

None.