Main Page   Modules   Data Structures   Related Pages  

FTP Operations

Initiate an FTP operation. More...

File or Directory Existence

Make Directory

Remove Directory

Delete

List

Move

Get

Put

3rd Party Transfer

Modification Time

Size

Abort

Typedefs


Detailed Description

Initiate an FTP operation.

This module contains the API functions for a user to request a get, put, third-party transfer, or other FTP file operation.


Typedef Documentation

typedef void(* globus_ftp_client_complete_callback_t)( void * user_arg, globus_ftp_client_handle_t * handle, globus_object_t * error)
 

Operation complete callback.

Every FTP Client operation (get, put, transfer, mkdir, etc) is asynchronous. A callback of this type is passed to each of the operation function calls to let the user know when the operation is complete. The completion callback is called only once per operation, after all other callbacks for the operation have returned.

Parameters:
user_arg  The user_arg parameter passed to the operation.
handle  The handle on which the operation was done.
error  A Globus error object indicating any problem which occurred, or GLOBUS_SUCCESS, if the operation completed successfully.


Function Documentation

globus_result_t globus_ftp_client_exists globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Check for the existence of a file or directory on an FTP server.

This function attempts to determine whether the specified URL points to a valid file or directory. The complete_callback will be invoked with the result of the existence check passed as a globus error object, or GLOBUS_SUCCESS.

Parameters:
handle  An FTP Client handle to use for the existence check operation.
url  The URL of the directory or file to check. The URL may be an ftp or gsiftp URL.
attr  Attributes to use for this operation.
complete_callback  Callback to be invoked once the existence operation is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • url is GLOBUS_NULL
  • url cannot be parsed
  • url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_mkdir globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Make a directory on an FTP server.

This function starts a mkdir operation on a FTP server.

When the response to the mkdir request has been received the complete_callback will be invoked with the result of the mkdir operation.

Parameters:
handle  An FTP Client handle to use for the mkdir operation.
url  The URL for the directory to create. The URL may be an ftp or gsiftp URL.
attr  Attributes for this operation.
complete_callback  Callback to be invoked once the mkdir is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_rmdir globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Make a directory on an FTP server.

This function starts a rmdir operation on a FTP server.

When the response to the rmdir request has been received the complete_callback will be invoked with the result of the rmdir operation.

Parameters:
handle  An FTP Client handle to use for the rmdir operation.
url  The URL for the directory to create. The URL may be an ftp or gsiftp URL.
attr  Attributes for this operation.
complete_callback  Callback to be invoked once the rmdir is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_delete globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Delete a file on an FTP server.

This function starts a delete operation on a FTP server. Note that this functions will only delete files, not directories.

When the response to the delete request has been received the complete_callback will be invoked with the result of the delete operation.

Parameters:
handle  An FTP Client handle to use for the delete operation.
url  The URL for the file to delete. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
complete_callback  Callback to be invoked once the delete is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_list globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Get a file listing from an FTP server.

This function starts a "NLST" transfer from an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_read() to retrieve the data associated with this listing.

When all of the data associated with the listing is retrieved, and all of the data callbacks have been called, or if the list request is aborted, the complete_callback will be invoked with the final status of the list.

Parameters:
handle  An FTP Client handle to use for the list operation.
url  The URL to list. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
complete_callback  Callback to be invoked once the "list" is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress
See also:
globus_ftp_client_register_read()

globus_result_t globus_ftp_client_verbose_list globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Get a file listing from an FTP server.

This function starts a "LIST" transfer from an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_read() to retrieve the data associated with this listing.

When all of the data associated with the listing is retrieved, and all of the data callbacks have been called, or if the list request is aborted, the complete_callback will be invoked with the final status of the list.

Parameters:
handle  An FTP Client handle to use for the list operation.
url  The URL to list. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
complete_callback  Callback to be invoked once the "list" is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress
See also:
globus_ftp_client_register_read()

globus_result_t globus_ftp_client_move globus_ftp_client_handle_t   u_handle,
const char *    source_url,
const char *    dest_url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Move a file on an FTP server.

This function starts a move (rename) operation on an FTP server. Note that this function does not move files between FTP servers and that the host:port part of the destination url is ignored.

When the response to the move request has been received the complete_callback will be invoked with the result of the move operation.

Parameters:
handle  An FTP Client handle to use for the move operation.
source_url  The URL for the file to move.
dest_url  The URL for the target of the move. The host:port part of this URL is ignored.
attr  Attributes for this operation.
complete_callback  Callback to be invoked once the move is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_get globus_ftp_client_handle_t   handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_restart_marker_t   restart,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Get a file from an FTP server.

This function starts a "get" file transfer from an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_read() to retrieve the data associated with this URL.

When all of the data associated with this URL is retrieved, and all of the data callbacks have been called, or if the get request is aborted, the complete_callback will be invoked with the final status of the get.

Parameters:
handle  An FTP Client handle to use for the get operation.
url  The URL to download. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
restart  Pointer to a restart marker.
complete_callback  Callback to be invoked once the "get" is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress
See also:
globus_ftp_client_register_read()

globus_result_t globus_ftp_client_partial_get globus_ftp_client_handle_t   handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_restart_marker_t   restart,
globus_off_t    partial_offset,
globus_off_t    partial_end_offset,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Get a file from an FTP server.

This function starts a "get" file transfer from an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_read() to retrieve the data associated with this URL.

When all of the data associated with this URL is retrieved, and all of the data callbacks have been called, or if the get request is aborted, the complete_callback will be invoked with the final status of the get.

Parameters:
handle  An FTP Client handle to use for the get operation.
url  The URL to download. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
restart  Pointer to a restart marker.
partial_offset  Starting offset for a partial file get.
partial_end_offset  Ending offset for a partial file get.
complete_callback  Callback to be invoked once the "get" is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_extended_get globus_ftp_client_handle_t   handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_restart_marker_t   restart,
const char *    eret_alg_str,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Get a file from an FTP server with server-side processing.

This function starts a "get" file transfer from an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_read() to retrieve the data associated with this URL.

When all of the data associated with this URL is retrieved, and all of the data callbacks have been called, or if the get request is aborted, the complete_callback will be invoked with the final status of the get.

This function differs from the globus_ftp_client_get() function by allowing the user to invoke server-side data processing algorithms. GridFTP servers may support support algorithms for data reduction or other customized data storage requirements. There is no client-side verification done on the algorithm string provided by the user. If the server does not understand the requested algorithm, the transfer will fail.

Parameters:
handle  An FTP Client handle to use for the get operation.
url  The URL to download. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
restart  Pointer to a restart marker.
eret_alg_str  The ERET algorithm string. This string contains information needed to invoke a server-specific data reduction algorithm on the file being retrieved.
complete_callback  Callback to be invoked once the "get" is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress
See also:
globus_ftp_client_register_read()

globus_result_t globus_ftp_client_put globus_ftp_client_handle_t   handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_restart_marker_t   restart,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Store a file on an FTP server.

This function starts a "put" file transfer to an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_write() to send the data associated with this URL.

When all of the data associated with this URL is sent, and all of the data callbacks have been called, or if the put request is aborted, the complete_callback will be invoked with the final status of the put.

Parameters:
handle  An FTP Client handle to use for the put operation.
url  The URL to store the data to. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
restart  Pointer to a restart marker.
complete_callback  Callback to be invoked once the "put" is completed.
callback_arg  Argument to be passed to the complete_callback.
See also:
globus_ftp_client_register_write()

globus_result_t globus_ftp_client_partial_put globus_ftp_client_handle_t   handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_restart_marker_t   restart,
globus_off_t    partial_offset,
globus_off_t    partial_end_offset,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Store a file on an FTP server.

This function starts a "put" file transfer to an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_write() to send the data associated with this URL.

When all of the data associated with this URL is sent, and all of the data callbacks have been called, or if the put request is aborted, the complete_callback will be invoked with the final status of the put.

Parameters:
handle  An FTP Client handle to use for the put operation.
url  The URL to store the data to. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
restart  Pointer to a restart marker.
partial_offset  Starting offset for a partial file put.
partial_end_offset  Ending offset for a partial file put.
complete_callback  Callback to be invoked once the "put" is completed.
callback_arg  Argument to be passed to the complete_callback.
See also:
globus_ftp_client_register_write()

globus_result_t globus_ftp_client_extended_put globus_ftp_client_handle_t   handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_ftp_client_restart_marker_t   restart,
const char *    esto_alg_str,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Store a file on an FTP server with server-side processing.

This function starts a "put" file transfer to an FTP server. If this function returns GLOBUS_SUCCESS, then the user may immediately begin calling globus_ftp_client_write() to send the data associated with this URL.

When all of the data associated with this URL is sent, and all of the data callbacks have been called, or if the put request is aborted, the complete_callback will be invoked with the final status of the put.

This function differs from the globus_ftp_client_put() function by allowing the user to invoke server-side data processing algorithms. GridFTP servers may support algorithms for data reduction or other customized data storage requirements. There is no client-side verification done on the alogirhtm string provided by the user. if the server does not understand the requested algorithm, the transfer will fail.

Parameters:
handle  An FTP Client handle to use for the put operation.
url  The URL to store the data to. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
restart  Pointer to a restart marker.
complete_callback  Callback to be invoked once the "put" is completed.
callback_arg  Argument to be passed to the complete_callback.
See also:
globus_ftp_client_register_write()

globus_result_t globus_ftp_client_third_party_transfer globus_ftp_client_handle_t   handle,
const char *    source_url,
globus_ftp_client_operationattr_t   source_attr,
const char *    dest_url,
globus_ftp_client_operationattr_t   dest_attr,
globus_ftp_client_restart_marker_t   restart,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Transfer a file between two FTP servers.

This function starts up a third-party file transfer between FTP server. This function returns immediately.

When the transfer is completed or if the transfer is aborted, the complete_callback will be invoked with the final status of the transfer.

Parameters:
handle  An FTP Client handle to use for the get operation.
source_url  The URL to transfer. The URL may be an ftp or gsiftp URL.
source_attr  Attributes for the souce URL.
dest_url  The destination URL for the transfer. The URL may be an ftp or gsiftp URL.
dest_attr  Attributes for the destination URL.
restart  Pointer to a restart marker.
complete_callback  Callback to be invoked once the "put" is completed.
callback_arg  Argument to be passed to the complete_callback.
Note:
The source_attr and dest_attr MUST be compatible. For example, the MODE and TYPE should match for both the source and destination.

globus_result_t globus_ftp_client_partial_third_party_transfer globus_ftp_client_handle_t   handle,
const char *    source_url,
globus_ftp_client_operationattr_t   source_attr,
const char *    dest_url,
globus_ftp_client_operationattr_t   dest_attr,
globus_ftp_client_restart_marker_t   restart,
globus_off_t    partial_offset,
globus_off_t    partial_end_offset,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Transfer a file between two FTP servers.

This function starts up a third-party file transfer between FTP server. This function returns immediately.

When the transfer is completed or if the transfer is aborted, the complete_callback will be invoked with the final status of the transfer.

Parameters:
handle  An FTP Client handle to use for the get operation.
source_url  The URL to transfer. The URL may be an ftp or gsiftp URL.
source_attr  Attributes for the souce URL.
dest_url  The destination URL for the transfer. The URL may be an ftp or gsiftp URL.
dest_attr  Attributes for the destination URL.
restart  Pointer to a restart marker.
partial_offset  Starting offset for a partial file get.
partial_end_offset  Ending offset for a partial file get.
complete_callback  Callback to be invoked once the "put" is completed.
callback_arg  Argument to be passed to the complete_callback.
Note:
The source_attr and dest_attr MUST be compatible. For example, the MODE and TYPE should match for both the source and destination.

globus_result_t globus_ftp_client_extended_third_party_transfer globus_ftp_client_handle_t   handle,
const char *    source_url,
globus_ftp_client_operationattr_t   source_attr,
const char *    eret_alg_str,
const char *    dest_url,
globus_ftp_client_operationattr_t   dest_attr,
const char *    esto_alg_str,
globus_ftp_client_restart_marker_t   restart,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Transfer a file between two FTP servers with server-side processing.

This function starts up a third-party file transfer between FTP server. This function returns immediately.

When the transfer is completed or if the transfer is aborted, the complete_callback will be invoked with the final status of the transfer.

This function differes from the globus_ftp_client_third_party_transfer() funciton by allowing the user to invoke server-side data processing algorithms. GridFTP servers may support algorithms for data reduction or other customized data storage requirements. There is no client-side verification done on the alogirhtm string provided by the user. if the server does not understand * the requested algorithm, the transfer will fail.

Parameters:
handle  An FTP Client handle to use for the get operation.
source_url  The URL to transfer. The URL may be an ftp or gsiftp URL.
source_attr  Attributes for the souce URL.
dest_url  The destination URL for the transfer. The URL may be an ftp or gsiftp URL.
dest_attr  Attributes for the destination URL.
restart  Pointer to a restart marker.
complete_callback  Callback to be invoked once the "put" is completed.
callback_arg  Argument to be passed to the complete_callback.
Note:
The source_attr and dest_attr MUST be compatible. For example, the MODE and TYPE should match for both the source and destination.

globus_result_t globus_ftp_client_modification_time globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_abstime_t *    modification_time,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Get a file's modification time from an FTP server.

This function requests the modification time of a file from an FTP server.

When the modification time request is completed or aborted, the complete_callback will be invoked with the final status of the operation. If the callback is returns without an error, the modification time will be stored in the globus_abstime_t value pointed to by the modification_time parameter to this function.

Parameters:
handle  An FTP Client handle to use for the list operation.
url  The URL to list. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
modification_time  A pointer to a globus_abstime_t to be filled with the modification time of the file, if it exists. Otherwise, the value pointed to by it is undefined.
complete_callback  Callback to be invoked once the modification time check is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • modification time is GLOBUS_NULL
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_size globus_ftp_client_handle_t   u_handle,
const char *    url,
globus_ftp_client_operationattr_t   attr,
globus_off_t *    size,
globus_ftp_client_complete_callback_t    complete_callback,
void *    callback_arg
 

Get a file's size from an FTP server.

This function requests the size of a file from an FTP server.

When the modification time request is completed or aborted, the complete_callback will be invoked with the final status of the operation. If the callback is returns without an error, the modification time will be stored in the globus_abstime_t value pointed to by the modification_time parameter to this function.

Note:
In ASCII mode, the size will be the size of the file after conversion to ASCII mode. The actual amount of data which is returned in the data callbacks may be less than this amount.
Parameters:
handle  An FTP Client handle to use for the list operation.
url  The URL to list. The URL may be an ftp or gsiftp URL.
attr  Attributes for this file transfer.
size  A pointer to a globus_off_t to be filled with the total size of the file, if it exists. Otherwise, the value pointed to by it is undefined.
complete_callback  Callback to be invoked once the size check is completed.
callback_arg  Argument to be passed to the complete_callback.
Returns:
This function returns an error when any of these conditions are true:
  • handle is GLOBUS_NULL
  • source_url is GLOBUS_NULL
  • source_url cannot be parsed
  • source_url is not a ftp or gsiftp url
  • size is GLOBUS_NULL
  • complete_callback is GLOBUS_NULL
  • handle already has an operation in progress

globus_result_t globus_ftp_client_abort globus_ftp_client_handle_t   u_handle
 

Abort the operation currently in progress.

Parameters:
handle  Handle which to abort.


about globus | grid research | globus toolkit | software development

Comments? webmaster@globus.org