Page 1 of 1

How can I change the save interval of Tags.Dat?

Posted: 14 Jul 2017 16:21
by Zonko
I just learned the tag.dat file, located at C:\Users\[username]\appdata\Roaming\XYplorer\tag.dat, isn't flushed to disk until the user calls File->SaveSettings.

I can't count the number of times I've lost tags due to not saving.

Is there a way to either :
* Automatically save tag.dat when a new tag is set/applied
* automatically save the settings every hour or some interval?

Re: How can I change the save interval of Tags.Dat?

Posted: 14 Jul 2017 16:26
by highend
Welcome to the forum

I don't think that saving on every new / changed tag would be such a good idea
Imagine you have 100k+ of tagged items (and no SSD)...

But you can use this setting:
Configuration | General | Startup & Exit | Autosave settings after this many minutes
and if you like
Configuration | General | Startup & Exit | Save settings on exit

Re: How can I change the save interval of Tags.Dat?

Posted: 05 Sep 2022 19:16
by daniel_m
I'd appreciate "a more frequent saving" of tag.dat as well. XYplorer is generally very stable. Still, it crashes every now and then. For people who use the Windows sleep mode, XYplorer rarely gets closed and opened again. I added a "save settings" button to the toolbar, but sometimes I forget to save my settings after I change some tags/labels. In that case, a crash discards the latest changes to the tag.dat.

I agree to not automatically saving the settings, at least not without a fail-save method to protect settings.ini from getting corrupted. The tag.dat should be less problematic. Adding an automatic backup system would make autosaving tag.dat safe.

I don't see a problem with "100+ tagged items (and no SSD)" either. Start a timer (e.g. 60s) whenever a tag/label was changed. The timer gets re-set with new tab/label changes. When the timer runs out, without new tab/label changes, save the tab.dat (and save the old tab.dat as tab.bak, or something like that).

Re: How can I change the save interval of Tags.Dat?

Posted: 05 Sep 2022 20:04
by elqasar2
There's a setting you can use to make tag.dat automatically save whenever any change is made:

Configuration | General | Startup & Exit | Save Settings | [x] Save changes to disk immediately

Click 'Apply To' and selects 'Tags'

Re: How can I change the save interval of Tags.Dat?

Posted: 05 Sep 2022 20:06
by jupe
You could also script save tags to a CEA event like tab switch or similar, to have it happen less frequently like it seems you want.

Re: How can I change the save interval of Tags.Dat?

Posted: 05 Sep 2022 20:09
by daniel_m
elqasar2 wrote: ↑05 Sep 2022 20:04 There's a setting you can use to make tag.dat automatically save whenever any change is made:

Configuration | General | Startup & Exit | Save Settings | [x] Save changes to disk immediately

Click 'Apply To' and selects 'Tags'
This is exactly what I was looking for. Thanks! 😊