def write_out_metadata(self, updated, dry_run=False): """ Write a copy of the metadata to a file :param updated: file object :param dry_run: :return: """ if not dry_run: updated.write(struct.pack("I", 0)) updated.write(struct.pack("I", self.id)) put_string(updated, 260, self.name) updated.write(struct.pack("I", 0)) if self.compressed: self.compr_object.aftercompress_callback_obj = compression.after_comp_callback(updated.tell(), updated) if not dry_run: updated.write(struct.pack("I", self.comp_size)) updated.write(struct.pack("I", self.size)) compa = 0 if self.compressed: compa = 1 updated.write(struct.pack("I", compa)) self.offset_writeback_location = updated.tell() # save the updated.write(struct.pack("I", self.offset))
def write_out_metadata(self, updated, dry_run=False): """ Write a copy of the metadata to a file :param updated: file object :param dry_run: :return: """ if not dry_run: updated.write(struct.pack("I", 0)) updated.write(struct.pack("I", self.id)) put_string(updated, 260, self.name) updated.write(struct.pack("I", 0)) if self.compressed: self.compr_object.aftercompress_callback_obj = compression.after_comp_callback( updated.tell(), updated) if not dry_run: updated.write(struct.pack("I", self.comp_size)) updated.write(struct.pack("I", self.size)) compa = 0 if self.compressed: compa = 1 updated.write(struct.pack("I", compa)) self.offset_writeback_location = updated.tell() # save the updated.write(struct.pack("I", self.offset))
def write_metadata(self, binfile, dry_run=False): if not dry_run: put_string(binfile, 8, self.dwpack) binfile.write(struct.pack("I", 0)) binfile.write(struct.pack("I", self.nfiles)) binfile.write(struct.pack("I", 0))