How to move file/dir to trash and restore them to original location afterwards?. Most answers on stackoverflow are for Windows or Mac OS. And some suggest to implement using linux commands.
Is there any C api that can perform this actions?
How to move file/dir to trash and restore them to original location afterwards?. Most answers on stackoverflow are for Windows or Mac OS. And some suggest to implement using linux commands.
Is there any C api that can perform this actions?
If you're looking for GNOME take a look at the C implementation of nautilus which links into that system and does things programmatically
https://gitlab.gnome.org/GNOME/nautilus/-/blob/master/src/nautilus-file-utilities.c
and the gio source which is a command line tool written in C which shows you how to get GFile objects which contain this
https://github.com/GNOME/glib/blob/master/gio/gio-tool-list.c https://developer.gnome.org/gio/stable/GFile.html#g-file-new-for-path
In particular, you will want the original locations which is in the file type used there
file->details->trash_orig_path