Grid Community Toolkit  6.2.1629922860 (tag: v6.2.20210826)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions
Reading and Writing Data

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)
 

Detailed Description

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 Documentation

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.

Parameters
user_argThe user_arg parameter passed to the read or write function.
handleThe handle on which the data block operation was done.
errorA Globus error object indicating any problem which occurred processing this data block, or or GLOBUS_SUCCESS if the operation completed successfully.
bufferThe data buffer passed to the original read or write call.
lengthThe amount of data in the data buffer. When reading data, this may be smaller than original buffer's length.
offsetThe offset into the file which this data block contains.
eofGLOBUS_TRUE if EOF has been reached on this data transfer, GLOBUS_FALSE otherwise. This may be set to GLOBUS_TRUE for multiple callbacks.

Function Documentation

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.

Parameters
handleA pointer to a FTP Client handle which contains state information about the get operation.
bufferA user-supplied buffer into which data from the FTP server will be stored.
buffer_lengthThe maximum amount of data that can be stored into the buffer.
callbackThe function to be called once the data has been read.
callback_argArgument passed to the callback function
See Also
globus_ftp_client_operationattr_set_read_all()
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.

Parameters
handleA pointer to a FTP Client handle which contains state information about the put operation.
bufferA user-supplied buffer containing the data to write to the server.
buffer_lengthThe size of the buffer to be written.
offsetThe 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
callbackThe function to be called once the data has been written.
callback_argArgument passed to the callback function