def copyfile(source, destination, buffer_size=1024 * 1024):
    source_descriptor = get_descriptor(source)
    destination_descriptor = get_descriptor(destination, read=False)

    while True:
        copy_buffer = source_descriptor.read(buffer_size)
        if copy_buffer:
            destination_descriptor.write(copy_buffer)
        else:
            break

    source_descriptor.close()
    destination_descriptor.close()
Copy a file from source to dest. source and dest
dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/common/utils.py/copyfile