Just a tip. There are many unique and useful utilities that you can write that use the SMAT files. You just need to be aware of the format of the files.
The .idx file contains lists of keyed lists. Therefore it can best be read using the lgets command. The lgets command will read a whole list at a time. Since the list is just one element, to access it as a keyed list, simply remove it from the list context. For example, consider a SMAT file with name of foo.idx:
set fd [open foo.idx] ;# Default mode is read only
while {[lgets $fd klist] >= 0} {
set klist [lindex $klist 0] ;# Remove from list format
echo [keylkeys klist]
# Add you own code here
}
The echo would yield:
MID SRCMID TYPE SOURCECONN ORIGSOURCECONN DESTCONN ORIGDESTCONN TIME PRIORITY DATAFMT SAVECONTEXT OFFSET LENGTH
For example to read the associated .msg file, just move to [keylget klist OFFSET] and read [keylget klist LENGTH] bytes.
You can get any other data you want from the .idx file by using keyed list commands. You could also set up searches, etc. Its left to your own needs and imagination. After all that’s why you get paid the big bucks 😛
Hope this helps
Charlie