Thought for T devs regarding occasional corruption of .tracktionedit files

Discussion about: tracktion.com
Post Reply New Topic
RELATED
PRODUCTS

Post

I've just remembered a method I used with previous programs I've written. Its aim is to avoid the loss of data when a computer fails during file writing, or in the event of other causes that might cause file corruption.

I've responded to a few people on here who have had corrupted Edit files. As these files are XML format, some of the data can be rescued, and the file reconstructed to some extent so that Waveform or Tracktion can at least open it. But data may well be lost.

This kind of happening was a worry with PC software I was writing a number of years ago. The solution I came up with was simple. You write two copies of the data file, consecutively.

Suppose we're in Waveform and want to save an Edit. Waveform saves the data as whatever.tracktionedit1 and, when that's done, saves it again as whatever.tracktionedit2.

This saving may happen several times in a session.

Normally both saved edit files are the same. When Waveform starts up, it reads the 1 file and it loads okay.

If there had been some sort of failure while writing the 2 file, the 1 file should be complete and intact. Waveform could start and at that point check the contents of 2. If it was damaged or different, it could be overwritten with the data from 1.

If the failure happened when writing file 1, Waveform would recognise the damage to file 1, read 2, and try to overwrite file 1.

That should make both files identical and intact for the new session.

It's far less likely that both files could be corrupted than just one of them.

The overhead to write two relatively small files isn't going to be much these days.

Anyway, just thought I'd toss the idea into daylight for consideration.
[W10-64, T5/6/7/W8/9/10/11/12/13, 32(to W8)&64 all, Spike],[W7-32, T5/6/7/W8, Gina16] everything underused.

Post Reply

Return to “Tracktion”