Not remembering backup files when opening
-
For years I have used Notepad++ and just kept a series of open tabs as “New 1”, “New 2”, and so on. Every time I close app and reopen they automatically reopen. Even if I reboot they automatically reopen. I have become dependent on this behavior working.
My company has always done forceful restarts of our PC for patches or updates they required installed. However, recently after these forced reboots Notepad++ has forgotten all last opened tabs and started like it was fresh with a single “New 1” tab. I have checked all Preferences, especially Backup Preference, and nothing changes.
I have found the backup folder does exist in my AppData\Roaming\Notepad++\Backup. If I look in there all the previous tabs I had opened are in there. I can rename that folder and then open all files and copy contents back into “New x” tabs. After this I can close Notead++ and reopen and all the previous tabs will be there. (In a new Backup folder created by Notepad++.) I can even restart my PC and all the tabs will be there again.
I can’t determine what is causing Notepad++ to have this new behavior and not open all the files that exist within its Backup folder.
Please give suggestion for both
-
Trying to determine what might cause this behavior and how to fix. Note: I have not found anyway to reproduce this as only my company forced reboot seems to cause this. Manually telling windows to reboot, restarting the app, or even killing the app in Task Manager doesn’t cause this to happen.
-
Is there anyway to force Notepad++ to reopen all those files in the backup folder as tabs that existed previously. (Moving the backup folder, opening each separately and copying back to new tabs is huge pain.)
I’m using current version of Notepad++ V8.1.2 (32 bit). I don’t remember what version I had previously, sure I skipped a few versions, but same behavior was happening. I upgraded thinking might help.
-
-
what is causing Notepad++ to have this new behavior and not open all the files that exist within its Backup folder.
You have misinterpreted things: it isn’t the presence of files in that folder that cause Notepad++ to open them; it is the presence of the entries for those files in session.xml . Thus, my conclusion is that during the forced restart, your session file got corrupted/deleted, and Notepad++ no longer had the pointers to those files.
Moving the backup folder, opening each separately and copying back to new tabs is huge pain.
Then don’t. You were bit once by the fact that a forced reboot caused an unexpected situation for Notepad++. Don’t gamble that it will never happen to you again – next time, it might be that the backup files, rather than the session file, are what get corrupted – and then the data will be gone. And then you are out of luck, unless software like Recuva can find some useful bits in the deleted/corrupted temporary file.
If you care enough about the data to get upset when you cannot immediately access it, then you should care enough about the data to save regularly. If you cannot be bothered to give files meaningful names and save them regularly, use a plugin like the AutoSave plugin. (Make sure to configure AutoSave after installing it; see this other post for a similar admonition, including detailed instructions on how to set up AutoSave plugin, because out of the box, AutoSave plugin doesn’t actually auto-save, until you have configured it.)
-
Thanks for the response.
I was unaware how Notepad++ operates and didn’t know it was the session.xml file that controls showing these files. How people chose to use a program is a personal preference. The app is already doing auto back of files in that folder and I don’t see a need to extend that to another folder. I know if I lost everything in those open tabs then so be it.I was asking from the standpoint that behavior was no longer doing the same thing I was used to. Not knowing the app I didn’t know it referenced that session.xml file and just thought it read everything in that directory and opened them.
Understanding how it operates actually answers both questions. I can make a script to rebuild that session file should I need to. More likely I’ll just keep a backup copy of that file every hour. If it corrupts because of these new company reboots I can just restore a previous hour file to reopen all tabs again.
-
@Steven-Smith said in Not remembering backup files when opening:
How people chose to use a program is a personal preference.
Yes, but your description is idiotic (IMO, sorry).
You lose something and you just want to keep working the same way you always have, albeit with a “script file” to protect you.Just give your file(s) a “hard name” on your disk and you no longer have to think about any of the mentioned issues again.
The trouble comes in when you let Notepad++ manage unnamed files for you. Should it do it right? Yep. Does it always? Nope. So, if you have data you care about, manage and protect it.
-
Thanks to both @Steven-Smith and to @PeterJones as I had exactly the same question.
I changed my username slightly with the new system and so, although I had copied session.xml, it was silently failing due to the different username in the file paths.
-
-