Python Forum
OS module and file/directory recovery - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: OS module and file/directory recovery (/thread-20232.html)



OS module and file/directory recovery - hikerguy62 - Aug-01-2019

I just came across the Python os module and have been tinkering with it. From what I've seen, it's pretty unforgiving when it comes to deleting folders (and probably files as well). I used the os.rmdir and shutil.rmtree and do not see these folders in the Recycle Bin. Is there a way to send files and folders to the Recycle Bin (rather than just vanquishing them forever)? These commands seem pretty risky if you don't watch what you're doing.

And for those who don't know, the OS module provides functions for interacting with the operating system. So, it's probably something that will come in handy for everyone.


RE: OS module and file/directory recovery - Gribouillis - Aug-02-2019

You could explore the send2trash project on pypi to see how it works on your platform.