#read a file local

1 messages · Page 1 of 1 (latest)

hot matrix
#

hello, I have 2 script in 2 disctinct project, the first handle a prompt and write in a file json, the second read the file 30* per seconde, verfy if it's diferent, and if it is do something with the json.
It's work, but I'm sure it's a really bad wai to do (make open and read 30 times per seconde), so I search a sugestion for optimise this part.
thank you for any advice.

tired panther
#

You can look at file attributes to look for updates and do the read+diff only when changed, or if your target os supports it, use a file watcher, which will call you back when the file/folder is changed.

hot matrix
#

thank you, I gonna try the first option in first time. I go to search how to axess file attributes, thanks :)

tired panther
#

Usually called stat