def copyfileobj(fsrc, fdst):
"""
Copy the contents of the file-like object fsrc to the file-like object
fdst.
:Arguments:
fsrc - file descriptor of the file to be copied
fdst - file descriptor of the file on which to be copied
:Return:
True/False - based on the success/failure of the operation
"""
status = False
try:
shutil.copyfileobj(fsrc, fdst)
status = True
except Exception as e:
print_error("copying file {} to file {} raised exception {}".
format(fsrc, fdst, str(e)))
return status
评论列表
文章目录