Checking to see if a text file has been updated

Post Reply
tarkenton
Posts: 30
Joined: Thu Feb 07, 2013 7:33 am

Checking to see if a text file has been updated

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

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

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

Post by phasma »

Use LuaFilesystem's 'attributes' function and return the last access time then just correlate.

Post Reply