func (d *Deleter) Dirs(paths []string) error {
	for _, p := range paths {
		// fail silently if the file does not exist
		if _, err := d.RenamerRemover.Stat(p); err != nil {
			if errors.Is(err, fs.ErrNotExist) {
				logger.Warnf("Directory %q does not exist and therefore cannot be deleted. Ignoring.", p)
				continue
			}

			return fmt.Errorf("check directory %q exists: %w", p, err)
		}

		if err := d.renameForDelete(p); err != nil {
			return fmt.Errorf("marking directory %q for deletion: %w", p, err)
		}
		d.dirs = append(d.dirs, p)
	}

	return nil
}
// Dirs designates directories to be deleted. Each directory marked will be renamed to add
// a `.delete` suffix. An error is returned if a directory could not be renamed.
// Note that if an error is returned, then some directories may be left renamed.
// Abort should be called to restore marked files/directories if this function returns an
// error.
Dirs designates directories to be deleted. Each directory marked will be renamed to add
a `.delete` suffix. An error is returned if a directory could not be renamed.
Note that if an error is returned, then some directories may be left renamed.
Abort should be called to restore marked files/directories if this function returns an
error.
// Dirs designates directories to be deleted . Each directory marked will be renamed to add // a ` . delete ` suffix . An error is returned if a directory could not be renamed . // Note that if an error is returned then some directories may be left renamed . // Abort should be called to restore marked files / directories if this function returns an // error .
func (d *Deleter) Dirs(paths []string) error {
	for _, p := range paths {
		if _, err := d.RenamerRemover.Stat(p); err != nil {
			if errors.Is(err, fs.ErrNotExist) {
				logger.Warnf("Directory %q does not exist and therefore cannot be deleted. Ignoring.", p)
				continue
			}
			return fmt.Errorf("check directory %q exists: %w", p, err)
		}
		if err := d.renameForDelete(p); err != nil {
			return fmt.Errorf("marking directory %q for deletion: %w", p, err)
		}
		d.dirs = append(d.dirs, p)
	}
	return nil
}
func ( d * Deleter ) Dirs ( paths [ ] string ) error { for _ , p := range paths { if _ , err := d . RenamerRemover . Stat ( p ) ; err != nil { if errors . Is ( err , fs . ErrNotExist ) { logger . Warnf ( " " , p ) continue } return fmt . Errorf ( " " , p , err ) } if err := d . renameForDelete ( p ) ; err != nil { return fmt . Errorf ( " " , p , err ) } d . dirs = append ( d . dirs , p ) } return nil }
Dirs designates directories to be deleted.
Dirs designates directories to be deleted .
// fail silently if the file does not exist