Poster of Linux kernelThe best gift for a Linux geek
Reading and Writing Data

Reading and Writing Data

Section: globus ftp client (3) Updated: Sat Oct 16 2010
Local index Up
 

NAME

Reading and Writing Data -

Certain FTP client operations require the user to supply buffers for reading or writing data to an FTP server.

 

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

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(), 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_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.

 

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:

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

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:

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

 

Author

Generated automatically by Doxygen for globus ftp client from the source code.


 

Index

NAME
Typedefs
Functions
Detailed Description
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)
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)
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)
Author

This document was created by man2html, using the manual pages.
Time: 21:47:00 GMT, April 16, 2011