Undo os.remove

C

chris.peressotti

Hi. I just used os.remove to get rid of some files -- unfortunately,
I realized afterward that I didn't really want to get rid of them. It
isn't life-or-death, here, but is there any way for me to get these
files back?

- Chris
 
P

Paul Rubin

Hi. I just used os.remove to get rid of some files -- unfortunately,
I realized afterward that I didn't really want to get rid of them. It
isn't life-or-death, here, but is there any way for me to get these
files back?

Try a websearch for file recovery utilities, nothing to do with Python
especially. "Directory Snoop" by Kent Briggs is supposedly pretty
good if you run Windoze.

One thing you should do is shut off your computer right away if it's
the same one where you deleted those files. If the freed disk sectors
get re-used by other files they are unrecoverable, and Windows is
always doing stuff that eats up disk sectors. Use a different
computer to search for recovery programs.
 
B

Ben Finney

Hi. I just used os.remove to get rid of some files --
unfortunately, I realized afterward that I didn't really want to get
rid of them. It isn't life-or-death, here, but is there any way for
me to get these files back?

Since 'os.remove' delegates the actual removal to your operating
system, it's a matter of whether your operating system has a way to
get those files back.

Most operating systems don't have a simple "bring this file back"
system call (the way they have a "remove this file" system call), so
Python can't provide such an interface. But your operating system
might provide a way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top