Grid Community Toolkit
6.2.1705709074 (tag: v6.2.20240202)
|
Reading and Writing Data. More...
Typedefs | |
typedef void(* | globus_ftp_client_data_callback_t )(void *user_arg, globus_ftp_client_handle_t *handle, globus_object_t *error, globus_byte_t *buffer, globus_size_t length, globus_off_t offset, globus_bool_t eof) |
Functions | |
globus_result_t | globus_ftp_client_register_read (globus_ftp_client_handle_t *handle, globus_byte_t *buffer, globus_size_t buffer_length, globus_ftp_client_data_callback_t callback, void *callback_arg) |
globus_result_t | globus_ftp_client_register_write (globus_ftp_client_handle_t *handle, globus_byte_t *buffer, globus_size_t buffer_length, globus_off_t offset, globus_bool_t eof, globus_ftp_client_data_callback_t callback, void *callback_arg) |
Reading and Writing Data.
Certain FTP client operations require the user to supply buffers for reading or writing data to an FTP server. These operations are globus_ftp_client_get(), globus_ftp_client_partial_get(), globus_ftp_client_put(), globus_ftp_client_partial_put(), globus_ftp_client_list(), globus_ftp_client_machine_list(), globus_ftp_client_recursive_list(), and globus_ftp_client_verbose_list().
When doing these operations, the user must pass data buffers to the FTP Client library. Data is read or written directly from the data buffers, without any internal copies being done.
The functions in this section of the manual may be called as soon as the operation function has returned. Multiple data blocks may be registered with the FTP Client Library at once, and may be sent in parallel to or from the FTP server if the GridFTP protocol extensions are being used.
typedef void(* globus_ftp_client_data_callback_t)(void *user_arg, globus_ftp_client_handle_t *handle, globus_object_t *error, globus_byte_t *buffer, globus_size_t length, globus_off_t offset, globus_bool_t eof) |
Data Callback.
Each read or write operation in the FTP Client library is asynchronous. A callback of this type is passed to each of the data operation function calls to let the user know when the data block has been processed.
user_arg | The user_arg parameter passed to the read or write function. |
handle | The handle on which the data block operation was done. |
error | A Globus error object indicating any problem which occurred processing this data block, or or GLOBUS_SUCCESS if the operation completed successfully. |
buffer | The data buffer passed to the original read or write call. |
length | The amount of data in the data buffer. When reading data, this may be smaller than original buffer's length. |
offset | The offset into the file which this data block contains. |
eof | GLOBUS_TRUE if EOF has been reached on this data transfer, GLOBUS_FALSE otherwise. This may be set to GLOBUS_TRUE for multiple callbacks. |
globus_result_t globus_ftp_client_register_read | ( | globus_ftp_client_handle_t * | handle, |
globus_byte_t * | buffer, | ||
globus_size_t | buffer_length, | ||
globus_ftp_client_data_callback_t | callback, | ||
void * | callback_arg | ||
) |
Register a data buffer to handle a part of the FTP data transfer.
The data buffer will be associated with the current get being performed on this client handle.
handle | A pointer to a FTP Client handle which contains state information about the get operation. |
buffer | A user-supplied buffer into which data from the FTP server will be stored. |
buffer_length | The maximum amount of data that can be stored into the buffer. |
callback | The function to be called once the data has been read. |
callback_arg | Argument passed to the callback function |
globus_result_t globus_ftp_client_register_write | ( | globus_ftp_client_handle_t * | handle, |
globus_byte_t * | buffer, | ||
globus_size_t | buffer_length, | ||
globus_off_t | offset, | ||
globus_bool_t | eof, | ||
globus_ftp_client_data_callback_t | callback, | ||
void * | callback_arg | ||
) |
Register a data buffer to handle a part of the FTP data transfer.
The data buffer will be associated with the current "put" being performed on this client handle. Multiple data buffers may be registered on a handle at once. There is no guaranteed ordering of the data callbacks in extended block mode.
handle | A pointer to a FTP Client handle which contains state information about the put operation. |
buffer | A user-supplied buffer containing the data to write to the server. |
buffer_length | The size of the buffer to be written. |
offset | The offset of the buffer to be written. In extended-block mode, the data does not need to be sent in order. In stream mode (the default), data must be sent in sequential order. The behavior is undefined if multiple writes overlap. |
eof | |
callback | The function to be called once the data has been written. |
callback_arg | Argument passed to the callback function |