Python Forum
OS module and file/directory recovery
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OS module and file/directory recovery
#1
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.
Reply
#2
You could explore the send2trash project on pypi to see how it works on your platform.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Excel password recovery tool for work OTH 6 4,873 Mar-06-2025, 03:49 PM
Last Post: Pedroski55
  FileNotFoundError: [Errno 2] No such file or directory although the file exists Arnibandyo 0 1,037 Aug-12-2024, 09:11 AM
Last Post: Arnibandyo
  "[Errno 2] No such file or directory" (.py file) IbrahimBennani 13 6,594 Jun-17-2024, 12:26 AM
Last Post: AdamHensley
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 8,080 Jun-27-2023, 01:17 PM
Last Post: diver999
  Extract file only (without a directory it is in) from ZIPIP tester_V 1 4,161 Jan-23-2023, 04:56 AM
Last Post: deanhystad
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 2,068 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  no such file or directory in SFTP saisankalpj 2 2,660 Nov-25-2022, 11:07 AM
Last Post: DeaD_EyE
Photo Making Zip file of a file and Directory Nasir 2 1,815 Oct-07-2022, 02:01 PM
Last Post: Nasir
  Failed to execute child process (No such file or directory) uriel 1 2,413 Sep-15-2022, 03:48 PM
Last Post: Gribouillis
  Need Help: FileNotFoundError:[Errno 2] No such file or directory python202209 5 6,122 Sep-12-2022, 04:50 AM
Last Post: python202209

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020