(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape")
Return a tar header as a string of 512 byte blocks.
Return a tar header as a string of 512 byte blocks.
Return a tar header as a string of 512 byte blocks .
def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape"):
        """Return a tar header as a string of 512 byte blocks.
        """
        info = self.get_info()

        if format == USTAR_FORMAT:
            return self.create_ustar_header(info, encoding, errors)
        elif format == GNU_FORMAT:
            return self.create_gnu_header(info, encoding, errors)
        elif format == PAX_FORMAT:
            return self.create_pax_header(info, encoding)
        else:
            raise ValueError("invalid format")
def tobuf ( self , format = DEFAULT_FORMAT , encoding = ENCODING , errors = "surrogateescape" ) : info = self . get_info ( ) if format == USTAR_FORMAT : return self . create_ustar_header ( info , encoding , errors ) elif format == GNU_FORMAT : return self . create_gnu_header ( info , encoding , errors ) elif format == PAX_FORMAT : return self . create_pax_header ( info , encoding ) else : raise ValueError ( "invalid format" )