Is it possible to recover deleted file via its Atom cache?


#1

Hi.

Recently I’ve tried to install LuaRocks to my flash drive, because the PC I’m running Atom is not mine and I don’t want to contaminate it. I am developing a library for Love2D, so for my convenience I kept Love2D executables, Atom executables, my library’s source code and other stuff in one folder called ‘bin’. After the installation started, LuaRocks deleted my ‘bin’ folder and created a new one. I killed the process of LuaRocks installer and started to download file recovery software. I was sleepy so I installed it to the flash drive from which I wanted to recover deleted source file. Now it’s totally unrecoverable. But I’ve noticed, that after I started Atom it showed me my lost source for a while and then opened blank file. I have a copy of my %APPDATA%\Atom made before I started Atom after accident deleting of my file, because I think that a cache of my source keeps somewhere in here. So, is it possible to recover my source file using data from this copy of %APPDATA%\Atom?


#2

If it eventually opened a blank file, then the source is most likely gone. You can try looking in %USERPROFILE%\.atom\storage to see if it is stored there.


#3

Unfortunately, there is nothing useful. But after I recovering %APPDATA\Atom from my backup and restart Atom it still shows me my source for a while, so, may be I can get at least a little part from this backup?


#4

It isn’t really a backup. Atom stores the state of the editor when you exit, including the contents of any files you have open. If the files weren’t open in Atom the last time you exited before stuff was deleted, then Atom doesn’t have any “backup” of it.


#5

They were opened in Atom. I made a screenshot of the moment while Atom shows me the files that aren’t exist now (ndt.lua at the left. Also I once got a copy of gone ndt-ui.lua source)


#6

I guess I’m not sure what question you have then?


#7

Well, I still can get only one exact piece of code via capturing a screenshot of it. But what I really need is ndt-ui.lua, because it have ~500 lines


#8

According to your screenshot, it appears that file is open:

So I’m still not sure what question you’re asking. If the file is open when you open Atom, can’t you use File > Save As... to store it someplace else?


#9

Nope. According to data I have in backup of %APPDATA%\Atom, Atom opens tab with ndt.lua at start. But the problem is that I can’t save this piece of code, because it shows only for a few milliseconds and then closes itself and shows a blank file instead.


#10

If the file is appearing, either

a) The file still exists when you’re starting Atom, or
b) There’s a screenshot of your workspace that is loaded when you launch Atom.

It’s probably a, unless Windows is doing something fancy and caching the last screen (because I can’t imagine Atom doing anything with screenshots).

If it’s a, you want to search through your %APPDATA%\Atom folder, and search for something that was in ndt-ui.lua, like require "LuaXml" (though I can only see that in ndt.lua so it might not be in ndt-ui.lua).

Windows search may not be sufficient. I don’t know what it ignores in terms of “System Files”, and I don’t know how Atom has stored it. If you have a Unix machine, grep may be a better option.

You may have already tried this, but there are a handful of easily-accessible search programs out there. If you want to use grep on Windows, you might want to try out Git-Bash (part of Git (link)).


#11

I had a very similar issue with atom 1.13.1 where it would not recover a previously open and unsaved file. Problem occurred when I opened a file through windows explorer while atom was not open. It would not remember my location or open that previous file. I looked in %userprofile%.atom\storage\application.json and found that the path was pointing to the last opened location. Changing hat back and opening atom again resulted in my previously open and unsaved file being loaded. Odd behavior.


#14

Lots of forums on Google ,as long as you select the "Data Recovery or How to recover lost files ", seconds later, you can get more tutorial about how to solve your question, in fact , that means they are recommending their tool to you, i doubt it very much ,