aftp_delete

The aftp_delete call deletes a single file on the AFTP server. A connection to the AFTP server must be established before using this call.

AFTP_ENTRY aftp_delete(
IN AFTP_HANDLE_TYPE
connection_id,
IN unsigned char AFTP_PTR
filename,
IN AFTP_LENGTH_TYPE
length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
filename
The name of the file to be removed. The format of this name can be either the native syntax on the AFTP server or the AFTP common naming convention described in the APPC Application Suite User's Guide. The file specified can contain either an absolute or relative path name.
length
The length of the filename 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_HANDLE_TYPE       connection_id;
    AFTP_RETURN_CODE_TYPE  aftp_rc;

    /* The value used for filespec will vary based on platform:
     *   VM common naming:       filespec="/a/foo*"
     *   VM native naming:       filespec="foo*.*.a"
     *   MVS PDS common naming:  filespec="/user.clist/foo*"
     *   MVS PDS native naming:  filespec="'user.clist(foo*)'"
     *   MVS sequential common:  filespec="/user.qual*.a*.**"
     *   MVS sequential native:  filespec="'user.qual*.a*.**'"
     */
    static unsigned char AFTP_PTR filespec = "/user.clist/foo*";

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

    /*
     * Delete a file
     */

    aftp_delete(
        connection_id,
        filespec,
        (AFTP_LENGTH_TYPE)strlen(filespec),
        &aftp_rc);

    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error deleting AFTP file.\n");
    }

}
 

Line Flows

The file name is sent to the AFTP server and the call waits for a response indicating the success or failure of the delete file operation.