Skip to content

Commit

Permalink
header size
Browse files Browse the repository at this point in the history
  • Loading branch information
anjor committed Aug 5, 2024
1 parent 905e951 commit 9e34079
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmd-car-split.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9e34079

Please sign in to comment.