Improve rename/copy/reomove API.
* examples/rename.c: Remove. * examples/fcopy.c: New file. * examples/fremove.c: New file. * examples/frename.c: New file. * examples/Makefile.am: Update. * include/mailutils/util.h (mu_rename_file): Add flags. (mu_remove_file): New function. (MU_COPY_OVERWRITE): New flag. * libmailutils/base/renamefile.c: New file. * libmailutils/base/Makefile.am: Add newe file. * libmailutils/base/copyfile.c: Fix error handling. * libmailutils/base/renamefile.c (mu_rename_file): Refuse to proceed if the destination file exists and MU_COPY_OVERWRITE flag is not set * libmailutils/diag/errors (MU_ERR_REMOVE_SOURCE) (MU_ERR_RESTORE_META): New errors * imap4d/rename.c (imap4d_rename): Use mu_rename_file * mh/forw.c: Likewise. * mh/mh_whatnow.c: Likewise. * mh/mhn.c: Likewise. * mh/send.c: Likewise. * include/mailutils/cstr.h (mu_str_count): New proto. * include/mailutils/util.h (mu_file_name_is_safe): New proto. * libmailutils/string/safefilename.c: New file. * libmailutils/string/strcount.c: New file. * libmailutils/string/Makefile.am: Update.
Showing
20 changed files
with
726 additions
and
94 deletions
examples/fremove.c
0 → 100644
examples/frename.c
0 → 100644
libmailutils/base/removefile.c
0 → 100644
libmailutils/string/safefilename.c
0 → 100644
libmailutils/string/strcount.c
0 → 100644
-
Please register or sign in to post a comment