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

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Zonko
Posts: 10
Joined: 14 Jul 2017 16:14

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

Post 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?

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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
One of my scripts helped you out? Please donate via Paypal

daniel_m
Posts: 241
Joined: 11 Apr 2010 11:47
Location: Windows 10 Pro 22H2, scaling 100%

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

Post 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).
XYplorer x64 (often the latest beta), Windows 10 Pro 22H2, 3840x2160 scaling 100%

elqasar2
Posts: 255
Joined: 27 Oct 2017 14:04
Location: Win 11, 100% scaling, v27.20.0700

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

Post 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'

jupe
Posts: 3577
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

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

Post 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.

daniel_m
Posts: 241
Joined: 11 Apr 2010 11:47
Location: Windows 10 Pro 22H2, scaling 100%

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

Post 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! 😊
XYplorer x64 (often the latest beta), Windows 10 Pro 22H2, 3840x2160 scaling 100%

Post Reply