Page 1 of 1

Checking to see if a text file has been updated

Posted: Mon Dec 08, 2014 5:36 am
by tarkenton
Hi all, quick question. Looking to make a little label that echos the contents of a text file, in this case a standalone program that places your currently playing song from a number of music players into a text file (https://github.com/dlrudie/Snip/releases/tag/v4.6.0). Of course, the tricky part is knowing when the file has been updated. Anyone have a tricky way to look for that, or is my initial thought to create a 1s timer that checks the value inside the file against the current_song variable the simplest/best way to go?

Re: Checking to see if a text file has been updated

Posted: Fri Dec 19, 2014 11:13 am
by fetaera
Use LuaFilesystem's 'attributes' function and return the last access time then just correlate.