From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tdms defrag modifies file permissions

Solved!
Go to solution

Hello everyone.

 

So after much fuss and stress, I've finally isolated an interesing issue that occurs when using the tdms defragment vi.

 

For some reason, deframenting a tdms file with the tdms defragment vi in windows XP resets the file permissions to allow full access to:

-Administrator

-Administrators

-SYSTEM

and removes ALL other existing permissions...

 

As a result it removes the "Full Access" file permission for "Everyone" which is neccesary to allow other computers on the network to change your files.

 

This means my satellite computers can no longer save to my server after I defragment the tdms files unless I manually add a "Full Access" for "Everyone" permission again to all the tdms files.

 

Does anyone know why the tdms defrag vi does this? Its very annoying and throws a major wrench in my attempts for full automation.

 

Thanks!

0 Kudos
Message 1 of 4
(2,971 Views)
Solution
Accepted by topic author Rdnfs2012

You are correct that TDMS Defragment changes the permissions of .tdms file, I can also see this on my machine. This might be because that the defragment node will generate a temporary .tdms file under the system TEMP folder, when the defragment process completes, it copies and replaces the original file with the defragmented file from TEMP directory, the file at the original path is overwritten and the original file permission is lost.

 

However, there is still a workaround for your issue, we can use the System Exec node in LabVIEW to call the "CACLS" command to set the "Everyone" permission back. The block diagram below shows how to set the "Everyone" permission for all .tdms files under one directory recursively:

 

 

defragment permission.png

 

Please refer to the VI in attachment for detail, the "CACLS" command is available under XP.

Message 2 of 4
(2,935 Views)

I just discovered that myself and thats exactly what I did. I just added the command line to the end of my automated defragging routine and used the defrag file target as the cacls target too.

 

Thanks

0 Kudos
Message 3 of 4
(2,930 Views)

Sorry for reviving the old thread, but I would appreciate if  LabVIEW makers would fix it for the next release. 

I would also like add TDMS Delete Data.vi to the offender list.

This bug affects muti-user and multi-server DAQ systems in a profound way, as the data files can not be accessed by any account other than the one that called those above VIs. 

 

In brief: "TDMS Delete Data.vi","TDMS Defragment.vi" and possibly any other file VI that uses temporal storage folder change the TDMS file permissions from inherited by default.

 

Message 4 of 4
(2,712 Views)