Need Explanation of a few Session.xml Parameters & Values
-
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!
-
@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
originalFileLastModifTimestampHighSee FILETIME for:
typedef struct _FILETIME { DWORD dwLowDateTime; DWORD dwHighDateTime; } FILETIME, *PFILETIME, *LPFILETIME;
I’m fairly sure that your
originalFileLastModifTimestampHigh
will correspond todwHighDateTime
andoriginalFileLastModifTimestamp
todwLowDateTime
. -
-
@alan-kilborn, thanks. I will read this over and see if I can get that number deciphered.
-
@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.
-
Any negative number
-X
, find the actual low word as2^32 - X
. So if it said-1
, the actual lower word would be4294967295
. If it said-1000000000
, it would be4294967296-1000000000 = 3294967296
, etc.Then you would use
4294967296*high + low
as the actual value. -
@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.
-
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
-
@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!