(r util.Reader, count uint64)
| 622 | } |
| 623 | |
| 624 | func readTimes(r util.Reader, count uint64) ([]time.Time, error) { |
| 625 | if err := checkUint64(count, true); err != nil { |
| 626 | return nil, err |
| 627 | } |
| 628 | |
| 629 | defined, err := readOptionalBool(r, count) |
| 630 | if err != nil { |
| 631 | return nil, err |
| 632 | } |
| 633 | |
| 634 | external, err := r.ReadByte() |
| 635 | if err != nil { |
| 636 | return nil, fmt.Errorf("readTimes: ReadByte error: %w", err) |
| 637 | } |
| 638 | |
| 639 | if external > 0 { |
| 640 | /* |
| 641 | _, err := readUint64(r) |
| 642 | if err != nil { |
| 643 | return nil, err |
| 644 | } |
| 645 | */ |
| 646 | // TODO Apparently we seek to this read offset and read the |
| 647 | // folder information from there. Not clear if the offset is |
| 648 | // absolute for the whole file, or relative to some known |
| 649 | // position in the file. Cowardly waiting for an example |
| 650 | return nil, errors.New("sevenzip: TODO readTimes external") //nolint:err113 |
| 651 | } |
| 652 | |
| 653 | times := make([]time.Time, count) |
| 654 | |
| 655 | for i := range defined { |
| 656 | if defined[i] { |
| 657 | var ft windows.Filetime |
| 658 | if err := binary.Read(r, binary.LittleEndian, &ft); err != nil { |
| 659 | return nil, fmt.Errorf("readTimes: Read error: %w", err) |
| 660 | } |
| 661 | |
| 662 | times[i] = time.Unix(0, ft.Nanoseconds()).UTC() |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | return times, nil |
| 667 | } |
| 668 | |
| 669 | func splitNull(data []byte, atEOF bool) (advance int, token []byte, err error) { |
| 670 | if atEOF && len(data) == 0 { |
no test coverage detected
searching dependent graphs…