• Login
Community
  • Login

Need Explanation of a few Session.xml Parameters & Values

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 3 Posters 2.6k 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.
  • D
    Daniel Tomberlin
    last edited by Daniel Tomberlin Mar 2, 2022, 6:34 PM Mar 2, 2022, 6:33 PM

    I’m looking for an explanation of a few parameters I see within the sessions.xml file located here (a sample of the code further below): C:\Users<username>\AppData\Roaming\Notepad++

    I’m specifically curious about the values in these parameters below:

    • originalFileLastModifTimestamp
    • originalFileLastModifTimestampHigh

    Also, what is the number at the end of the backupFilePath parameter of the “new” file/tab?

    <File firstVisibleLine="0" xOffset="0" scrollWidth="9423" startPos="120" endPos="120" selMode="0" offset="0" wrapCount="1" lang="SQL" encoding="-1" userReadOnly="no" filename="\\mypath\myfilename.sql" backupFilePath="" originalFileLastModifTimestamp="-386892058" originalFileLastModifTimestampHigh="30736076" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="1140719616" mapWrapIndentMode="-1" mapIsWrap="no" />
    
    <File firstVisibleLine="6" xOffset="0" scrollWidth="3990" startPos="2488" endPos="2488" selMode="0" offset="0" wrapCount="18" lang="SQL" encoding="-1" userReadOnly="no" filename="new 1" backupFilePath="C:\Users\username\AppData\Roaming\Notepad++\backup\new 1@2020-09-01_101742" originalFileLastModifTimestamp="0" originalFileLastModifTimestampHigh="0" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="0" mapWrapIndentMode="-1" mapIsWrap="no" />
    

    I clicked the “Sort Tabs” button from that feature from the Window > Windows module thinking it would open another dialogue with more options, but instead it sorted by Name.

    I’m hoping an explanation of these values may help me sort these tabs back manually in this file.

    Thanks!

    A 1 Reply Last reply Mar 2, 2022, 8:07 PM Reply Quote 0
    • A
      Alan Kilborn @Daniel Tomberlin
      last edited by Mar 2, 2022, 8:07 PM

      @daniel-tomberlin said in Need Explanation of a few Session.xml Parameters & Values:

      I’m specifically curious about the values in these parameters below:

      originalFileLastModifTimestamp
      originalFileLastModifTimestampHigh

      See FILETIME for:

      typedef struct _FILETIME {
        DWORD dwLowDateTime;
        DWORD dwHighDateTime;
      } FILETIME, *PFILETIME, *LPFILETIME;
      

      I’m fairly sure that your originalFileLastModifTimestampHigh will correspond to dwHighDateTime and originalFileLastModifTimestamp to dwLowDateTime.

      D 2 Replies Last reply Mar 2, 2022, 9:04 PM Reply Quote 3
      • P PeterJones referenced this topic on Mar 2, 2022, 8:54 PM
      • D
        Daniel Tomberlin @Alan Kilborn
        last edited by Mar 2, 2022, 9:04 PM

        @alan-kilborn, thanks. I will read this over and see if I can get that number deciphered.

        1 Reply Last reply Reply Quote 0
        • D
          Daniel Tomberlin @Alan Kilborn
          last edited by Daniel Tomberlin Mar 3, 2022, 6:57 PM Mar 3, 2022, 6:55 PM

          @alan-kilborn, I tried to find a way to convert FILETIME and I think I found an online converter (first tool), but I’m left more confused, especially with some of these notepad++ values being negative and 9-10 digits long.

          P 1 Reply Last reply Mar 3, 2022, 6:57 PM Reply Quote 0
          • P
            PeterJones @Daniel Tomberlin
            last edited by PeterJones Mar 3, 2022, 7:00 PM Mar 3, 2022, 6:57 PM

            @daniel-tomberlin

            Any negative number -X, find the actual low word as 2^32 - X. So if it said -1, the actual lower word would be 4294967295. If it said -1000000000, it would be 4294967296-1000000000 = 3294967296, etc.

            Then you would use 4294967296*high + low as the actual value.

            D 1 Reply Last reply Mar 3, 2022, 7:14 PM Reply Quote 2
            • D
              Daniel Tomberlin @PeterJones
              last edited by Daniel Tomberlin Mar 3, 2022, 7:17 PM Mar 3, 2022, 7:14 PM

              @peterjones, I’m not following your formula, especially the meaning of the ^ symbol (exponent I presume). Let’s use these two values below…

              * originalFileLastModifTimestamp="-386892058" 
              * originalFileLastModifTimestampHigh="30736076"
              

              The formula should look like this:

              ( 2^32 - (-386892058) ) * 30736076 + (-386892058) = 18-digit LDAP/FILETIME timestamp
              

              Thanks btw. I’m good at math and some non-programming code (SQL, JS, HTML,CSS), but do not have experience with these codes.

              P 1 Reply Last reply Mar 3, 2022, 7:19 PM Reply Quote 0
              • P
                PeterJones @Daniel Tomberlin
                last edited by PeterJones Mar 3, 2022, 7:22 PM Mar 3, 2022, 7:19 PM

                @daniel-tomberlin

                high = 30736076 (from originalFileLastModifTimestampHigh)
                low = -386892058 = -X (so X = 386892058) (from originalFileLastModifTimestamp)
                2^32 = 4294967296 (yes, exponentiation)
                full value = high * 2^32 + (2^32 - X) = 30736076 * 4294967296  + (4294967296 - 386892058)
                

                and if it’s not negative, it’s just something like:

                high = 30736076
                low = 123456789
                full value = high * 2^32 + X = 30736076 * 4294967296  + 123456789
                
                D 1 Reply Last reply Mar 3, 2022, 7:29 PM Reply Quote 3
                • D
                  Daniel Tomberlin @PeterJones
                  last edited by Mar 3, 2022, 7:29 PM

                  @PeterJones, thanks for clarifying. I got a sensible conversion from the online tool after entering the formula into Google to calculate an answer to provide it.

                  So with this example, entering the calculated answer of 1.3201045e+17 into the online converter gave me Monday, April 29, 2019 8:56:40 PM, which is exactly what I needed.

                  Thanks again @Alan-Kilborn and @PeterJones!

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