diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fm.c | 17 | ||||
| -rw-r--r-- | src/fm.h | 1 |
2 files changed, 18 insertions, 0 deletions
@@ -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; +} @@ -70,4 +70,5 @@ void get_permission(mode_t mode, char *str); int new_dir(fm_info *info); +int fm_rm(const char *path); #endif /* SF_FM_H */ |
