Community
    • Login

    Need Explanation of a few Session.xml Parameters & Values

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 2.3k 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.
    • Daniel TomberlinD
      Daniel Tomberlin
      last edited by Daniel Tomberlin

      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!

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Daniel Tomberlin
        last edited by

        @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.

        Daniel TomberlinD 2 Replies Last reply Reply Quote 3
        • PeterJonesP PeterJones referenced this topic on
        • Daniel TomberlinD
          Daniel Tomberlin @Alan Kilborn
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • Daniel TomberlinD
            Daniel Tomberlin @Alan Kilborn
            last edited by Daniel Tomberlin

            @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.

            PeterJonesP 1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @Daniel Tomberlin
              last edited by PeterJones

              @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.

              Daniel TomberlinD 1 Reply Last reply Reply Quote 2
              • Daniel TomberlinD
                Daniel Tomberlin @PeterJones
                last edited by Daniel Tomberlin

                @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.

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • PeterJonesP
                  PeterJones @Daniel Tomberlin
                  last edited by PeterJones

                  @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
                  
                  Daniel TomberlinD 1 Reply Last reply Reply Quote 3
                  • Daniel TomberlinD
                    Daniel Tomberlin @PeterJones
                    last edited by

                    @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
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors