• Login
Community
  • Login

How does npp persist and restore files that were opened between startup?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 335 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    ElusiveTau
    last edited by Mar 13, 2020, 8:31 PM

    This is a question about the source code. I’ve asked around about how to persist application data and the general response has been:

    1. Write data to a file (plaintext, serialization)
    2. Write data to a database

    I wanted to know how and where (what source code file/method) NPP handles persistence. Nevermind the question of what I’m trying to do. I’m just interested in how it’s implemented in this text editor.

    One example where I think persistence is used is to open files that were previously closed when the user exits npp. The names of those files must be saved somewhere and execution must know where to look to get the names of those files to reload them when npp is restored.

    I’ve downloaded the source code for npp from github but there are a lot of files to go through. It’d help if you can point me to the right folder/source code/method, etc.

    A 1 Reply Last reply Mar 14, 2020, 1:14 AM Reply Quote 0
    • A
      Alan Kilborn @ElusiveTau
      last edited by Mar 14, 2020, 1:14 AM

      @ElusiveTau said in How does npp persist and restore files that were opened between startup?:

      persistence is used is to open files that were previously closed when the user exits npp. The names of those files must be saved somewhere

      session.xml

      but there are a lot of files to go through. It’d help if you can point me to…

      Like everybody else that is interested, you have to just dig in.

      E 1 Reply Last reply Mar 14, 2020, 3:55 AM Reply Quote 2
      • E
        ElusiveTau @Alan Kilborn
        last edited by Mar 14, 2020, 3:55 AM

        @Alan-Kilborn Thanks Alan. For posterity this mentions it’s on the AppData path.

        A 1 Reply Last reply Mar 14, 2020, 12:38 PM Reply Quote 1
        • A
          Alan Kilborn @ElusiveTau
          last edited by Mar 14, 2020, 12:38 PM

          @ElusiveTau

          But it isn’t always on the “appdata” path. I could be located in the same folder as notepad++.exe is! In fact, that’s my preferred place for it.

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors