pub fn write_tar_header(&mut self, name: &str, size: u64) -> Result<()> {
        let mut header = Header::new_gnu();
        header.set_path(Path::new(name))?;
        header.set_entry_type(EntryType::Regular);
        header.set_size(size);
        // The checksum must be set to ensure that the tar reader implementation
        // in golang can correctly parse the header.
        header.set_cksum();
        self.write_all(header.as_bytes())?;
        Ok(())
    }
// This is a tar-like structure, except that we put the tar header after the
// data. The advantage is that we do not need to determine the size of the data
// first, so that we can write the blob data by stream without seek to improve
// the performance of the blob dump by using fifo, if we need to read the bootstrap
// data quickly, first need to read the 512 bytes tar header from the end of blob
// file first, and then seek offset to read bootstrap data.
This is a tar-like structure, except that we put the tar header after the
data. The advantage is that we do not need to determine the size of the data
first, so that we can write the blob data by stream without seek to improve
the performance of the blob dump by using fifo, if we need to read the bootstrap
data quickly, first need to read the 512 bytes tar header from the end of blob
file first, and then seek offset to read bootstrap data.
This is a tar - like structure except that we put the tar header after the data . The advantage is that we do not need to determine the size of the data first so that we can write the blob data by stream without seek to improve the performance of the blob dump by using fifo if we need to read the bootstrap data quickly first need to read the 512 bytes tar header from the end of blob file first and then seek offset to read bootstrap data .
pub fn write_tar_header(&mut self, name: &str, size: u64) -> Result<()> {
        let mut header = Header::new_gnu();
        header.set_path(Path::new(name))?;
        header.set_entry_type(EntryType::Regular);
        header.set_size(size);
        // The checksum must be set to ensure that the tar reader implementation
        // in golang can correctly parse the header.
        header.set_cksum();
        self.write_all(header.as_bytes())?;
        Ok(())
    }
pub fn write_tar_header ( & mut self , name : & str , size : u64 ) -> Result < ( ) > { let mut header = Header :: new_gnu ( ) ; header . set_path ( Path :: new ( name ) ) ? ; header . set_entry_type ( EntryType :: Regular ) ; header . set_size ( size ) ; // The checksum must be set to ensure that the tar reader implementation // in golang can correctly parse the header. header . set_cksum ( ) ; self . write_all ( header . as_bytes ( ) ) ? ; Ok ( ( ) ) }
This is a tar-like structure, except that we put the tar header after the
data.
This is a tar - like structure except that we put the tar header after the data .
&mut self
name
&str
size
u64
&mut self
name
&str
size
u64