Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #62742

Re: Recovering deleted files

References <85df4275-b5a8-41e3-a7aa-80b640790c68@googlegroups.com>
Date 2013-12-27 02:45 +1100
Subject Re: Recovering deleted files
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4634.1388072741.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Dec 26, 2013 at 3:44 PM, George Tang <geosxbox@gmail.com> wrote:
> I am new to python and was trying to program with txt files, and tried to move the txt file to a new directory. i did not read very carefully about what shutil.move(src, dst) does and it deleted some of my files. How do i recover my lost files. plz help!
>

Ouch. I'm afraid Python can't really help you there; you have to go to
your OS and file system now. Do as little as you possibly can on that
disk and you might be able to recover the contents. If you're lucky,
your file system won't have reused those parts of the disk, so
everything'll be intact... if you're REALLY lucky, you might even be
able to find the bits you want without searching the whole disk. But
it depends now on your OS and FS, not on Python.

This is why we make backups of all important files. I like to use
source control (git for me, or you could use Mercurial or another one
with the same result), which makes backing up an inherent part of all
work. But everyone has those critical files that they didn't know
weren't backed up... :(

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Recovering deleted files George Tang <geosxbox@gmail.com> - 2013-12-25 20:44 -0800
  Re: Recovering deleted files Chris Angelico <rosuav@gmail.com> - 2013-12-27 02:45 +1100
  Re: Recovering deleted files Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-12-26 12:19 -0500
    Re: Recovering deleted files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-27 09:37 +1100
  Re: Recovering deleted files Rick Johnson <rantingrickjohnson@gmail.com> - 2013-12-26 16:10 -0800

csiph-web