I have a c++ application that creates text file locally and update the value. I want to get the data from this text file using javascript only when this document is updated. I found a solution on the internet which is either using setInterval or simply trying to get the data from the file. Can anyone help me with this?
Asked
Active
Viewed 42 times
0
-
1Are you familiar with nodejs? Because reading files directly from browsers is problematic. – YetAnotherBot Jan 10 '19 at 11:26
-
1If you can't make any communication between your javascript runtime and your c++ script runtime there isn't much else to do other than checking the last edit datetime of the file (or the size, eventually, but it may be slightly risky). Otherwise, you may think about wrapping your C++ code in a node module and handle a callback, that would be quite clever. https://nodejs.org/api/addons.html – briosheje Jan 10 '19 at 11:27