A C library for moving files and folders to the Recycle Bin.
git clone https://github.com/thechampagne/libtrash.git
cd libtrash
cargo build
#include <stdio.h>
#include <trash.h>
int main()
{
const char* arr[] = { "file.txt", "file2.txt" };
if (trash_delete_all(arr, 2) != 0)
{
printf("Something went wrong with trash_delete_all\n");
return -1;
}
if (trash_delete("file.txt") != 0)
{
printf("Something went wrong with trash_delete\n");
return -1;
}
return 0;
}
This repo is released under the MIT.