diff options
Diffstat (limited to 'src/note.c')
-rw-r--r-- | src/note.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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. |