From 9ad19594dfc9eadd93a788dcd387409299ee7498 Mon Sep 17 00:00:00 2001 From: verdant Date: Wed, 5 Aug 2026 21:19:28 +0800 Subject: Implement remove file or directory --- src/fm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/fm.c') 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; +} -- cgit v1.2.3