MCPcopy Create free account
hub / github.com/bodgit/sevenzip / readAttributes

Function readAttributes

types.go:730–770  ·  view source on GitHub ↗
(r util.Reader, count uint64)

Source from the content-addressed store, hash-verified

728}
729
730func readAttributes(r util.Reader, count uint64) ([]uint32, error) {
731 if err := checkUint64(count, true); err != nil {
732 return nil, err
733 }
734
735 defined, err := readOptionalBool(r, count)
736 if err != nil {
737 return nil, err
738 }
739
740 external, err := r.ReadByte()
741 if err != nil {
742 return nil, fmt.Errorf("readAttributes: ReadByte error: %w", err)
743 }
744
745 if external > 0 {
746 /*
747 _, err := readUint64(r)
748 if err != nil {
749 return nil, err
750 }
751 */
752 // TODO Apparently we seek to this read offset and read the
753 // folder information from there. Not clear if the offset is
754 // absolute for the whole file, or relative to some known
755 // position in the file. Cowardly waiting for an example
756 return nil, errors.New("sevenzip: TODO readAttributes external") //nolint:err113
757 }
758
759 attributes := make([]uint32, count)
760
761 for i := range defined {
762 if defined[i] {
763 if err := binary.Read(r, binary.LittleEndian, &attributes[i]); err != nil {
764 return nil, fmt.Errorf("readAttributes: Read error: %w", err)
765 }
766 }
767 }
768
769 return attributes, nil
770}
771
772//nolint:cyclop,funlen,gocognit,gocyclo
773func readFilesInfo(r util.Reader) (*filesInfo, error) {

Callers 1

readFilesInfoFunction · 0.85

Calls 4

checkUint64Function · 0.85
readOptionalBoolFunction · 0.85
ReadByteMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…