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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -