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
);
{
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");
}
}
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.