def concat_job(job, options, file_ids):
"""
Merge zero or more VG protobuf files into one by concatenation. Returns the
merged file ID.
"""
with job.fileStore.writeGlobalFileStream() as (cat_handle, cat_id):
# Make one merged file
for part_id in file_ids:
# For each part file
with job.fileStore.readGlobalFileStream(part_id) as part_handle:
# Open it
# And stream it to the combined file
shutil.copyfileobj(part_handle, cat_handle)
return cat_id
评论列表
文章目录