ryobg / JContainers

JSON-based data structures for Papyrus - the TESV Skyrim SE scripting language
MIT License
107 stars 23 forks source link

OS function support in lua #63

Closed RealAntithesis closed 5 years ago

RealAntithesis commented 5 years ago

Are the lua 'os' functions supported such as os.date(), os.time() and os.clock()? I'm getting errors that there was an "attempt to call field 'clock' (a nil value)" etc when I try to use them. The reason I was thinking of using them (os.clock() particularly) was to avoid my log function from writing to file too often (which causes slowdowns whenever the file is opened, written and closed) so I was going to buffer writes into a local variable and only flush the text to the file every second or two.

ryobg commented 5 years ago

I think these may be disabled then, as far I remember the Lua support relies on explicit subset of libraries enabled. If you remember we had to enable the bit operations before time. And likely these os something were not enabled in order to avoid abuse on your system.

You may try flushing on number of records, size or certain event instead.

RealAntithesis commented 5 years ago

Yep, I'll do an explicit flush then - that should be fine, thanks.