Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for zeroBlock (0.06 sec)

  1. 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)
  2. 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)
  3. 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)
Back to top