Checking to see if a text file has been updated

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

Checking to see if a text file has been updated

Post by tarkenton » Mon Dec 08, 2014 5:36 am

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?

fetaera
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm

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

Post by fetaera » Fri Dec 19, 2014 11:13 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests