- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for zeroBlock (0.1 sec)
-
src/archive/tar/writer.go
func (tw *Writer) Flush() error { if tw.err != nil { return tw.err } if nb := tw.curr.logicalRemaining(); nb > 0 { return fmt.Errorf("archive/tar: missed writing %d bytes", nb) } if _, tw.err = tw.w.Write(zeroBlock[:tw.pad]); tw.err != nil { return tw.err } tw.pad = 0 return nil } // WriteHeader writes hdr and prepares to accept the file's contents.
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Wed Oct 02 14:22:59 UTC 2024 - 19.6K bytes - Viewed (0) -
src/archive/tar/format.go
// blockPadding computes the number of bytes needed to pad offset up to the // nearest block edge where 0 <= n < blockSize. func blockPadding(offset int64) (n int64) { return -offset & (blockSize - 1) } var zeroBlock block type block [blockSize]byte // Convert block to any number of formats. func (b *block) toV7() *headerV7 { return (*headerV7)(b) } func (b *block) toGNU() *headerGNU { return (*headerGNU)(b) }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Oct 13 18:36:46 UTC 2023 - 11.3K bytes - Viewed (0) -
src/archive/tar/reader.go
return nil, nil, err // EOF is okay here; exactly 0 bytes read } if bytes.Equal(tr.blk[:], zeroBlock[:]) { if _, err := io.ReadFull(tr.r, tr.blk[:]); err != nil { return nil, nil, err // EOF is okay here; exactly 1 block of zeros read } if bytes.Equal(tr.blk[:], zeroBlock[:]) { return nil, nil, io.EOF // normal EOF; exactly 2 block of zeros read }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Mar 08 01:59:14 UTC 2024 - 26.8K bytes - Viewed (0) -
src/archive/tar/reader_test.go
t.Errorf("test %d, Header.Size = %d, want %d", i, hdr.Size, v.wantSize) } } } func TestReadGNUSparsePAXHeaders(t *testing.T) { padInput := func(s string) string { return s + string(zeroBlock[:blockPadding(int64(len(s)))]) } vectors := []struct { inputData string inputHdrs map[string]string wantMap sparseDatas wantSize int64 wantName string wantErr error
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Thu Oct 03 15:48:09 UTC 2024 - 46.9K bytes - Viewed (0)