From 9e340799c3cc2c436f5ba83cb83d67c204b013bb Mon Sep 17 00:00:00 2001 From: anjor Date: Mon, 5 Aug 2024 08:46:26 +0100 Subject: [PATCH] header size --- cmd-car-split.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd-car-split.go b/cmd-car-split.go index cc96cc4b..c0cafb9c 100644 --- a/cmd-car-split.go +++ b/cmd-car-split.go @@ -67,11 +67,12 @@ type carFile struct { } type Metadata struct { - FileName string `yaml:"filename"` - FileSize int64 `yaml:"fileSize"` - FirstSlot int `yaml:"firstSlot"` - LastSlot int `yaml:"lastSlot"` - Cid string `yaml:"cid"` + FileName string `yaml:"filename"` + FileSize int64 `yaml:"fileSize"` + FirstSlot int `yaml:"firstSlot"` + LastSlot int `yaml:"lastSlot"` + Cid string `yaml:"cid"` + HeaderSize int64 `yaml:"headerSize"` } func newCmd_SplitCar() *cli.Command { @@ -183,7 +184,7 @@ func newCmd_SplitCar() *cli.Command { carFiles = append(carFiles, carFile{name: fmt.Sprintf("epoch-%d-%d.car", epoch, currentFileNum), commP: commCid, payloadCid: sl.(cidlink.Link).Cid, paddedSize: ps, fileSize: currentFileSize}) - metadata = append(metadata, Metadata{FileName: currentSubsetInfo.fileName, FileSize: currentFileSize, FirstSlot: currentSubsetInfo.firstSlot, LastSlot: currentSubsetInfo.lastSlot, Cid: sl.String()}) + metadata = append(metadata, Metadata{FileName: currentSubsetInfo.fileName, FileSize: currentFileSize, FirstSlot: currentSubsetInfo.firstSlot, LastSlot: currentSubsetInfo.lastSlot, Cid: sl.String(), HeaderSize: int64(len(nulRootCarHeader))}) err = closeFile(bufferedWriter, currentFile) if err != nil {