summaryrefslogtreecommitdiff
path: root/src/note.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/note.c')
-rw-r--r--src/note.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/note.c b/src/note.c
index 2bc828d..bb2ffb9 100644
--- a/src/note.c
+++ b/src/note.c
@@ -84,9 +84,16 @@ int note_cat(note_t* note) {
*
* @return int Success or failure
*/
-// int note::rm() {
-// return remove( _path.out().c_str() );
-// }
+int note_rm(note_t* note) {
+ // Verify file exists.
+ FILE* f = fopen(note->path, "r");
+ if(f) {
+ return remove(note->path);
+ fclose(f);
+ } else {
+ return 1;
+ }
+}
/**
* Gets the filename of the current note instance without its extension.

Generated by cgit