code: def WriteFileHeader(self, arcname=None, st=None):
      
  
      if st is None:
        raise ValueError("Stat object can't be None.")
  
      self.cur_file_size = 0
  
      self.cur_info = self._tar_fd.tarinfo()
      self.cur_info.tarfile = self._tar_fd
      self.cur_info.type = tarfile.REGTYPE
      self.cur_info.name = SmartStr(arcname)
      self.cur_info.size = st.st_size
      self.cur_info.mode = st.st_mode
      self.cur_info.mtime = st.st_mtime or time.time()
  
      self._tar_fd.addfile(self.cur_info)
  
      return self._stream.GetValueAndReset()
docs: Writes file header.