#(apememadide) Lacks way to check whether `<yaml>` tag exists

1 messages · Page 1 of 1 (latest)

midnight plinth
#

I have a custom system_save event that fires before shutdown and on my autosave delta time event.
I want to use that event to save a yml file, but said yaml file might not exist. The file is quickly opened and closed after the server boot, and might get opened again if a user uses it. If it's ever opened and editted in this manner, I want to save it using the common system_save custom event.

The thing is, because I'm not sure it exists, I first need to validate it... which I apparently have no way to do ?
All tags error when used on <yaml[foo]> when it isn't loaded: https://paste.denizenscript.com/View/122663

Can't use is_truthy, can't use exists, can't use if_null, and can't use yaml.has_changes.
Also, if I just let Denizen deal with it in case it doesn't exist, it also errors (Error Message: Unknown YAML ID 'foo' )

I also can't "just force it" and open it before saying regardless, because doing so overrides any in-memory change, defeating the whole purpose. (in addition to just being a dumb approach anyways)

How should I handle that ?

hearty bluffBOT
#

(apememadide) Lacks way to check whether <yaml> tag exists

hearty bluffBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

midnight plinth
#

I might have missed something, otherwise having <yaml[foo].exists> would be rather useful here

midnight plinth
#

Ah my bad, <yaml.list> is actually a thing