what happens to "backup" when more than one files of same name (different folders) are open



  • say, if my file name is _in1.txt, npp saves the backup with the name of _in1.txt.bak in the default backup or in custom backup folder.

    What happens if I have two files open with the same name, _in1.txt, one is in, say, C: and other is in, say, E:?

    I have exactly this situation, have two files in different hdd folders opened in npp,
    BUT I see only one file saved in backup folder?

    Where is other file’s backup. Why is it not getting saved.

    I have simple backup, and am not using default backup folder and have created my custom backup folder in E:



  • @V-S-Rawat said:

    …simple backup, and am not using default backup folder and have created my custom backup folder…

    I don’t think Simple Backup is designed for your use case (same-named files). Perhaps try Verbose Backup? It is not perfect for your use case, but might be better.





  • That thread reads
    “as soon as you save the file, the temporary auto backup will be removed from there (removed from %AppData%\Notepad++\backup, as it was saved already to it’s original location), and the previous version of this file will be saved to where the original file is located, but with an additional file extension .bak (eg. the previous version of myfile.txt will then be called myfile.txt.bak)”

    No, File is not removed from backup folder. it remains there. All files that are always open in my npp are always found in backup folder, whether i manually save them or not. I don’t know whether it is saved or unsaved version.



  • @V-S-Rawat

    you have to differentiate between backup (myfile.txt.bak) files and temporary snapshot backups of unsaved files.

    if you have snapshots and periodic backups enabled, the backup files will look like this: myfile.txt@2019-02-15_151704

    once you edit a file, and keep it unsaved, you will get these backup files at your snapshot backup folder.
    as soon as you save the file, they will be removed from there.
    (those files will only exist, as long as your file tab is marked red, as not saved)


    now “backup on save”, which creates files like myfile.txt.bak, is something completely different:

    if you have “backup on save” enabled, and not set a custom backup directory, every time you save a file, the previous version of that file will be saved at the same location as the original file, and named myfile.txt.bak.

    those bak files are never deleted, and are a fail safe, so that you can revert to the previous state, if something went wrong.



  • “not set a custom backup directory,”

    does setting a “custom backup directory” changes the behavior of backup?

    Why should it? and what kind of changes?

    I am just vary of default locations of all programs as the program gets right to alter that folder in any way it chooses for whatever reason. That is why wherever I find a way, I change a default folder to my own location in E:\MyData.

    Other than that, I didn’t want backup to change any action that it otherwise does.



  • @V-S-Rawat

    does setting a “custom backup directory” changes the behavior of backup?
    Why should it? and what kind of changes?

    yes, if a custom backup directory is set at the backup on save section, the .bak file containing the previous version will not be stored where the original file is, but always inside this folder.



  • @Meta-Chuh That is ok, that .bak file is store in the folder and not along with the original file.

    I had not seen .bak file ever stored at the location of original file.

    but .bak file, that was getting stored in the default backup folder will be get stored in my custom backup folder, so I understood. And that is ok. It means that npp is taking my custom folder for all activities it does with default folder. so there is no change.

    What other activities are getting changed and why?



  • @V-S-Rawat

    What other activities are getting changed and why?

    only those mentioned above, as far as i know no other activities get changed.


Log in to reply