Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
Restart Markers

Restart Markers. More...

Data Structures

union  globus_ftp_client_restart_marker_t
 Restart marker.This structure is may be either a stream mode transfer offset, or an extended block mode byte range. More...
 

Functions

globus_result_t globus_ftp_client_restart_marker_init (globus_ftp_client_restart_marker_t *marker)
 
globus_result_t globus_ftp_client_restart_marker_copy (globus_ftp_client_restart_marker_t *new_marker, globus_ftp_client_restart_marker_t *marker)
 
globus_result_t globus_ftp_client_restart_marker_destroy (globus_ftp_client_restart_marker_t *marker)
 
globus_result_t globus_ftp_client_restart_marker_insert_range (globus_ftp_client_restart_marker_t *marker, globus_off_t offset, globus_off_t end_offset)
 
globus_result_t globus_ftp_client_restart_marker_set_ascii_offset (globus_ftp_client_restart_marker_t *marker, globus_off_t offset, globus_off_t ascii_offset)
 
globus_result_t globus_ftp_client_restart_marker_set_offset (globus_ftp_client_restart_marker_t *marker, globus_off_t offset)
 
globus_result_t globus_ftp_client_restart_marker_get_total (globus_ftp_client_restart_marker_t *marker, globus_off_t *total_bytes)
 
globus_result_t globus_ftp_client_restart_marker_to_string (globus_ftp_client_restart_marker_t *marker, char **marker_string)
 
globus_result_t globus_ftp_client_restart_marker_from_string (globus_ftp_client_restart_marker_t *marker, const char *marker_string)
 

Detailed Description

Restart Markers.

FTP Restart Markers

The Globus FTP Client library provides the ability to start a file transfer from a known location into the file. This is accomplished by passing a restart marker to the globus_ftp_client_get(), globus_ftp_client_put(), or globus_ftp_client_third_party_transfer() functions.

Function Documentation

globus_result_t globus_ftp_client_restart_marker_copy ( globus_ftp_client_restart_marker_t new_marker,
globus_ftp_client_restart_marker_t marker 
)

Create a copy of a restart marker.

This function copies the contents of marker to new_marker.

Parameters
new_markerA pointer to a new restart marker.
markerThe marker to copy.
See Also
globus_ftp_client_restart_marker_init(), globus_ftp_client_restart_marker_destroy()
globus_result_t globus_ftp_client_restart_marker_destroy ( globus_ftp_client_restart_marker_t marker)

Destroy a restart marker.

Parameters
markerRestart marker. This marker must be initialized by either calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy()
See Also
globus_ftp_client_restart_marker_t, globus_ftp_client_restart_marker_init(), globus_ftp_client_restart_marker_copy()
globus_result_t globus_ftp_client_restart_marker_from_string ( globus_ftp_client_restart_marker_t marker,
const char *  marker_string 
)

Initialize a restart marker from a string.

This function initializes a new restart, marker, based on the marker_string parameter. The string may be either a single offset for a stream-mode restart marker, or a comma-separated list of start-end ranges.

Parameters
markerThe restart marker to be initialized.
marker_stringThe string containing a textual representation of a restart marker.
See Also
Restart Markers
globus_result_t globus_ftp_client_restart_marker_get_total ( globus_ftp_client_restart_marker_t marker,
globus_off_t *  total_bytes 
)

Get total bytes accounted for in restart marker

This function will return the sum of all bytes accounted for in a restart marker. If this restart marker contains a stream offset then this value is the same as the offset (not the ascii offset) that it was set with. If it is a range list, it a sum of all the bytes in the ranges.

Parameters
markerA previously initialized or copied restart marker
total_bytespointer to storage for total bytes in marker
Returns
  • Error on NULL marker or total bytes
globus_result_t globus_ftp_client_restart_marker_init ( globus_ftp_client_restart_marker_t marker)

Initialize a restart marker.

Parameters
markerNew restart marker.
See Also
globus_ftp_client_restart_marker_t, globus_ftp_client_restart_marker_destroy()
globus_result_t globus_ftp_client_restart_marker_insert_range ( globus_ftp_client_restart_marker_t marker,
globus_off_t  offset,
globus_off_t  end_offset 
)

Insert a range into a restart marker

This function updates a restart marker with a new byte range, suitable for using to restart an extended block mode transfer. Adjacent ranges within the marker will be combined into a single entry in the marker.

The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy().

A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_set_offset() will result in a marker suitable only for use restarting an extended block mode transfer.

Parameters
markerA restart marker
offsetThe starting offset of the range.
end_offsetThe ending offset of the range.
See Also
globus_ftp_client_restart_marker_set_offset() globus_ftp_client_operationattr_set_mode()
globus_result_t globus_ftp_client_restart_marker_set_ascii_offset ( globus_ftp_client_restart_marker_t marker,
globus_off_t  offset,
globus_off_t  ascii_offset 
)

Set the offset for a restart marker.

This function modifies a restart marker to contain a stream offset, suitable for using to restart a steam mode transfer.

The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy().

A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_insert_range() will delete the ranges associated with the marker, and replace it with a marker suitable only for use restarting a stream mode transfer.

When restarting an ASCII type transfer, use globus_ftp_client_restart_marker_set_ascii_offset() to set both the offset used in the local representation of an ACSII file, and the network representation of the ASCII file. For UNIX systems, the former includes counts newlines as one character towards the file offset, and the latter counts them as 2 characters (CRLF).

Parameters
markerA restart marker
offsetThe local stream offset.
ascii_offsetThe network ascii representation of the offset.
See Also
globus_ftp_client_restart_marker_insert_range(), globus_ftp_client_restart_marker_set_offset(), globus_ftp_client_operationattr_set_mode(), globus_ftp_client_operationattr_set_type()
globus_result_t globus_ftp_client_restart_marker_set_offset ( globus_ftp_client_restart_marker_t marker,
globus_off_t  offset 
)

Set the offset for a restart marker.

This function modifies a restart marker to contain a stream offset, suitable for using to restart a steam mode transfer.

The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy().

A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_insert_range() will delete the ranges associated with the marker, and replace it with a marker suitable only for use restarting a stream mode transfer.

When restarting an ASCII type transfer, the offset must take into account the additional carriage return characters added to the data stream.

Parameters
markerA restart marker
offsetThe stream offset
See Also
globus_ftp_client_restart_marker_insert_range(), globus_ftp_client_operationattr_set_mode(), globus_ftp_client_operationattr_set_type()
globus_result_t globus_ftp_client_restart_marker_to_string ( globus_ftp_client_restart_marker_t marker,
char **  marker_string 
)

Create a string representation of a restart marker.

This function sets the marker_string parameter to point to a freshly allocated string suitable for sending as an argument to the FTP REST command, or for a later call to globus_ftp_client_restart_marker_from_string().

The string pointed to by marker_string must be freed by the caller.

Parameters
markerAn initialized FTP client restart marker.
marker_stringA pointer to a char * to be set to a freshly allocated marker string.
See Also
Restart Markers