aboutsummaryrefslogtreecommitdiffstats
path: root/src/fm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fm.c')
-rw-r--r--src/fm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/fm.c b/src/fm.c
index 1af1586..06a980c 100644
--- a/src/fm.c
+++ b/src/fm.c
@@ -586,3 +586,20 @@ fm_rename(fm_info *info)
return 0;
}
+/*
+ REATURN VALUE:
+ -1: error
+ -2: cancel
+ */
+int
+fm_rm(const char *path)
+{
+ if (!path) {
+ return -1;
+ }
+
+ if (y_or_n("Delete it?"))
+ return (remove(path) == 0) ? 0 : -1;
+ else
+ return -2;
+}