code: func (p *Partition) deleteNonManifestFiles(m *Manifest) error {
  	dir, err := os.Open(p.path)
  	if err != nil {
  		return err
  	}
  	defer dir.Close()
  
  	fis, err := dir.Readdir(-1)
  	if err != nil {
  		return err
  	}
  
  	// Loop over all files and remove any not in the manifest.
  	for _, fi := range fis {
  		filename := filepath.Base(fi.Name())
  		if filename == ManifestFileName || filename == StatsFileName || m.HasFile(filename) {
  			continue
  		}
  
  		if err := os.RemoveAll(filename); err != nil {
  			return err
  		}
  	}
  
  	return dir.Close()
  }
docs: // deleteNonManifestFiles removes all files not in the manifest.