Moving files to Trash Can in Linux using C++ -
i'm trying move (delete) file trash can (in linux) using c++ (also using qt4 gui). unfortunately seems quite difficult , far can tell there isn't unified api it.
i application run not on kde on gnome, xfce , other linux desktop environments. that's why i'm searching more universal approach.
the best find far is:
- send2trash - that's using python/qt4 , not c++/qt4
- trash-cli - has drawback of being stand alone command line program , not library
i happy approach requires little desktop environment specific code possible. or in other words that's independent kde/gnome/xfce components possible.
any in finding solution (if there one) appreciated.
the answer in
http://www.freedesktop.org/wiki/specifications/trash-spec
for every user “home trash” directory must available. name , location $xdg_data_home/trash
you need write c++ code move file such directory.
you can move files using boost file system , can retrieve xdg_data_home value using cstlib getenv.
Comments
Post a Comment