Send Files To Trash On All PlatformsVirgil Dupras2010-05-03 If you've ever needed to send files to trash in your cross-platform application, you've probably noticed the painful void in your toolkit. It's just not there. You can copy, move, delete files, but you can't send them to the trash. There's no easy solution (until now) and you need to implement platform-specific code for Mac OS X, Windows and Linux. On Mac OS X, you have to call On Windows, a On Linux, it's free-for-all (pun intended... in hindsight). There's no unified API to send files to the trash. The convention seems to be that sending stuff in In other words, it's a mess. You thought you could code your cute Qt app once and run it everywhere, but that damn trash thing gets in your way. Well, if you use Python, you're in luck because there's a library for that now! Say hello to send2trash. It's a cross-platform library that sends files to trash using native API calls (without external dependencies). >>> from send2trash import send2trash >>> send2trash('some_file') |
|
|
This site is best viewed with Opera while listening to The White Stripes |
|