Commit 0883984c authored by Roland Haas's avatar Roland Haas
Browse files

add rename routine

parent 059b8f25
......@@ -277,6 +277,23 @@ class GlobusTransferHelper:
self.task_wait(transfer_response)
return transfer_response
def rename(self, endpoint, oldpath, newpath, synchronous = False):
"""
Rename a file or directory
Inputs:
endpoint - globus endpoint UUID on which files should be listed
srcpath - the path of the object to rename
newpath - the new path of the object
synchronous - wait until done (defatult: True)
Returns:
a globus TransferResponse object
"""
transfer_response = \
self.tclient.operation_rename(endpoint, oldpath, newpath)
if synchronous:
self.task_wait(transfer_response)
return transfer_response
if __name__ == '__main__':
# log in, then quit. Useful for scripted use
transfer = GlobusTransferHelper()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment