(r util.Reader, count uint64)
| 728 | } |
| 729 | |
| 730 | func 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 |
| 773 | func readFilesInfo(r util.Reader) (*filesInfo, error) { |
no test coverage detected
searching dependent graphs…