- if (unlink(path) < 0) {
- bb_perror_msg("unable to remove `%s'", path);
- return -1;
- }
+ /* !ISDIR */
+ if ((!(flags & FILEUTILS_FORCE)
+ && access(path, W_OK) < 0
+ && !S_ISLNK(path_stat.st_mode)
+ && isatty(0))
+ || (flags & FILEUTILS_INTERACTIVE)
+ ) {
+ fprintf(stderr, "%s: remove '%s'? ", applet_name, path);
+ if (!bb_ask_confirmation())
+ return 0;
+ }