macOS: move deleted file to Trash

As opposed to permanently deleting it.  As requested:

  https://sourceforge.net/p/tuxpaint/feature-requests/148/
This commit is contained in:
Mark Kim 2022-07-02 22:03:41 -04:00
parent d289d407ad
commit ed885f887d
5 changed files with 30 additions and 7 deletions

View file

@ -20,6 +20,7 @@
(See COPYING.txt)
*/
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <libgen.h>
#include <limits.h>
@ -86,3 +87,9 @@ const char *apple_picturesPath(void)
{
return IOS_PICTURES_PATH;
}
int apple_trash(const char *path)
{
return unlink(path);
}