The aftp_local_query_current_dir call queries the current working directory on the AFTP client. A connection to the AFTP server is not required before using this call.
See AFTP File and Directory Concept for details on how the directory concept is handled for supported operating systems.
AFTP_ENTRY aftp_local_query_current_dir(
IN AFTP_HANDLE_TYPE connection_id,
OUT unsigned char AFTP_PTR directory,
IN AFTP_LENGTH_TYPE directory_size,
OUT AFTP_LENGTH_TYPE AFTP_PTR returned_length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR return_code
);
Use the AFTP_FILE_NAME_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.
{
AFTP_HANDLE_TYPE connection_id;
AFTP_RETURN_CODE_TYPE aftp_rc;
unsigned char directory[AFTP_FILE_NAME_SIZE+1];
AFTP_LENGTH_TYPE length;
/*
* Before issuing the example call, you must have:
* a connection_id, use: aftp_create()
*/
/*
* Query the current working directory on the
* AFTP client.
*/
aftp_local_query_current_dir(
connection_id,
directory,
(AFTP_LENGTH_TYPE)sizeof(directory)-1,
&length,
&aftp_rc);
directory[length] = '\0';
if (aftp_rc != AFTP_RC_OK) {
fprintf(stderr, "Error in query of local current directory.\n");
}
}
None.