Lines Matching defs:ent

202 /* Prompt whether to remove FILENAME (ent->, if required via a combination of
216 prompt (FTS const *fts, FTSENT const *ent, bool is_dir,
222 char const *full_name = ent->fts_path;
223 char const *filename = ent->fts_accpath;
237 if (ent->fts_number)
405 fts_skip_tree (FTS *fts, FTSENT *ent)
407 fts_set (fts, ent, FTS_SKIP);
409 ent = fts_read (fts);
416 mark_ancestor_dirs (FTSENT *ent)
419 for (p = ent->fts_parent; FTS_ROOTLEVEL <= p->fts_level; p = p->fts_parent)
431 excise (FTS *fts, FTSENT *ent, struct rm_options const *x, bool is_dir)
434 if (unlinkat (fts->fts_cwd_fd, ent->fts_accpath, flag) == 0)
440 : _("removed %s\n")), quote (ent->fts_path));
452 if ( ! (lstatat (fts->fts_cwd_fd, ent->fts_accpath, &st)
464 if (ent->fts_info == FTS_DNR)
465 errno = ent->fts_errno;
466 error (0, errno, _("cannot remove %s"), quote (ent->fts_path));
467 mark_ancestor_dirs (ent);
478 rm_fts (FTS *fts, FTSENT *ent, struct rm_options const *x)
480 switch (ent->fts_info)
487 error (0, EISDIR, _("cannot remove %s"), quote (ent->fts_path));
488 mark_ancestor_dirs (ent);
489 fts_skip_tree (fts, ent);
494 if (ent->fts_level == FTS_ROOTLEVEL)
496 if (strip_trailing_slashes (ent->fts_path))
497 ent->fts_pathlen = strlen (ent->fts_path);
501 if (dot_or_dotdot (last_component (ent->fts_accpath)))
504 quote (ent->fts_path));
505 fts_skip_tree (fts, ent);
511 if (ROOT_DEV_INO_CHECK (x->root_dev_ino, ent->fts_statp))
513 ROOT_DEV_INO_WARN (ent->fts_path);
514 fts_skip_tree (fts, ent);
521 enum RM_status s = prompt (fts, ent, true /*is_dir*/, x,
528 s = excise (fts, ent, x, true);
529 fts_skip_tree (fts, ent);
534 mark_ancestor_dirs (ent);
535 fts_skip_tree (fts, ent);
553 if (ent->fts_info == FTS_DP
555 && FTS_ROOTLEVEL < ent->fts_level
556 && ent->fts_statp->st_dev != fts->fts_dev)
558 mark_ancestor_dirs (ent);
560 quote (ent->fts_path));
565 bool is_dir = ent->fts_info == FTS_DP || ent->fts_info == FTS_DNR;
566 enum RM_status s = prompt (fts, ent, is_dir, x, PA_REMOVE_DIR, NULL);
569 return excise (fts, ent, x, is_dir);
574 emit_cycle_warning (ent->fts_path);
575 fts_skip_tree (fts, ent);
581 error (0, ent->fts_errno, _("traversal failed: %s"),
582 quote (ent->fts_path));
583 fts_skip_tree (fts, ent);
589 ent->fts_info,
590 quote (ent->fts_path),
617 FTSENT *ent;
620 ent = fts_read (fts);
621 if (ent == NULL)
631 s = rm_fts (fts, ent, x);