The aftp_create_dir call creates a new directory on the AFTP server. A connection to the AFTP server must be established before using this call.
Platform differences are as follows:
See AFTP File and Directory Concept for details on how the directory concept is handled for supported operating systems.
AFTP_ENTRY aftp_create_dir(
IN AFTP_HANDLE_TYPE connection_id,
IN unsigned char AFTP_PTR directory,
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 not supported
* MVS PDS common naming: directory="/user.clist/"
* MVS PDS native naming: directory="'user.clist'"
* NT native naming: directory="d:\\newdir"
* NT common naming: directory="/d:/newdir"
*/
static unsigned char AFTP_PTR directory = "/user.clist/";
/*
* Before issuing the example call, you must have:
* a connection_id, use: aftp_create()
* a connection to server, use: aftp_connect()
*/
aftp_create_dir(
connection_id,
directory,
(AFTP_LENGTH_TYPE)strlen(directory),
&aftp_rc);
if (aftp_rc != AFTP_RC_OK) {
fprintf(stderr, "Error creating directory.\n");
}
}
The directory name is sent to the AFTP server and the call waits for a response indicating the success or failure of the create directory operation.