LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Hooovahh

Set TDMS Index Mod Date to TDMS Mod Date

Status: New

TDMS files generally come in pairs.  There is the TDMS file itself which contains all the data and meta data stored in the file.  And there is usually a tdms_index file.  This is the file with the meta data in it, but not the actual data.  The idea being that this index file is created from the original file, but since it doesn't contain all the extra data, it is faster to search through for a particular offset in the file to find something.

 

If a TDMS file exists in a folder without a tdms_index file, it will generally be created when calling the TDMS Open function.  This means when DIAdem indexes it, or when Excel Importer opens it, or when Scout opens it, this index file is created.  Often a useful way of looking at a folder of logs is to look at the Date Modified or Date Created and look at the newest.  But if we are viewing a folder of TDMS files which don't have the indexes, as soon as we open one to view it, the index file will be created with the modified and creation date being set to right now.  This suggestion is to have it be set to the same value as the original TDMS file.  As always pictures are useful.  Here is a folder of TDMS files sorted by the date modified.

 

Before Open.png

After double clicking that file the TDMS editor of choice opens it and the directory looks like this:

After Open.png

The index file is created, but since it has a newer mod date it moves to the top of the list.  My suggestion is to have the index file have the creation and mod date set to the TDMS file so the directory will look like this after it is created:

Proposal.png

Yes I realize you can write code to set this but I can't think of a reason why I would ever want to know what the date and time that the index file was created.  I'm only interested in the data, not the index file.  If this is implemented on the TDMS API side of things, then all tools that get made from that point forward will have the file modification set automatically.

2 Comments
RavensFan
Knight of NI

I understand your reasoning.  But I wonder if that is a violating a basic principle of the file system.  You are basically creating a file now, and are saying it was created longer ago than that.  You're basically lying to anyone looking at the directory about when the file was created.  It's like backdating a check.

 

I think the best practice is what you are showing in your pictures where the filename has a good date format that allows you to sort by name, and effectively are sorting by date.

 

 

Hooovahh
Proven Zealot

You make valid points, and it I agree that someone messing with file dates can be problematic.  Which is partially why I put it up for a vote.  My reasoning is I've never been interested in knowing the date of index, only the date of the data. 

 

Also what isn't seen in my example logs is that the DUT serial number is actually put before the first "_".  I could put the DUT serial after the date and time, but my users like sorting by the file name for finding the DUT they want, and they like sorting by Mod Date of the files for that instead.  I see their reasoning.