Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'python.': 0.02; 'bits': 0.09; 'mercurial': 0.09; 'subject:files': 0.09; 'cc:addr:python- list': 0.11; 'python': 0.11; 'dst)': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'directory.': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'help!': 0.26; 'possibly': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'work.': 0.31; 'george': 0.31; 'txt': 0.31; 'file': 0.32; 'critical': 0.32; 'another': 0.32; 'everyone': 0.33; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'disk': 0.36; "didn't": 0.36; 'searching': 0.37; 'depends': 0.38; 'files': 0.38; 'pm,': 0.38; 'little': 0.38; 'does': 0.39; 'how': 0.40; 'even': 0.60; 'read': 0.60; 'lost': 0.61; 'new': 0.61; "you're": 0.61; 'afraid': 0.65; '26,': 0.68; 'carefully': 0.74; 'inherent': 0.84; 'contents.': 0.91; 'recover': 0.91; 'to:none': 0.92; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=X2w5I/RWhfbSWgqFiMykEGwYIAimDpPOcBO23b+IMc8=; b=EFCvNmrycYl7J9sl/tIvcwqVbrPQf+Qpfyjmh6o9dzWTCq0alMa+sIsinKY+3ynpPI LMSrMtEtLC7qe4gZe5yssaeoTQc/YU+DAINTuIx5t5TINIf155Fn+vjQDdIY2ZYAcI5l 9D0G2phdlLQRK6A9twpXhepxMAUOAmpcZ2wM3+tbvW6KmJ/uVHOH5erNahxg5WoXXHpP 8zVaXSSHfKsCfxdmRB3nti2IWj+Y8NloDv8zwlBeju00VKUYTyx2V0Dp3wvs5SBI6Vmf 3pU0Bb4nETtDiimlZhfP+9HWqdLyoq2m1MzBE5WnIWZUDHSMvlC+UFEflsYblGYsOwvx 8vmw== MIME-Version: 1.0 X-Received: by 10.66.66.234 with SMTP id i10mr2481192pat.127.1388072737559; Thu, 26 Dec 2013 07:45:37 -0800 (PST) In-Reply-To: <85df4275-b5a8-41e3-a7aa-80b640790c68@googlegroups.com> References: <85df4275-b5a8-41e3-a7aa-80b640790c68@googlegroups.com> Date: Fri, 27 Dec 2013 02:45:37 +1100 Subject: Re: Recovering deleted files From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388072741 news.xs4all.nl 2890 [2001:888:2000:d::a6]:53403 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62742 On Thu, Dec 26, 2013 at 3:44 PM, George Tang 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