Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys,
i am reading out a .txt file in my little application. This file is updated then and now and i want the page to reload everytime this files was changed. Is this even possible? I considered writing a function which checks every second if the file was updated, but how can I figure out that it really was updated?

Any suggestions?
Posted
Comments
Mohibur Rashid 29-Jul-14 20:49pm    
what is your server or server scripting language?

1 solution

I wasn't sure that this could be done, but a little research led me to an article (and codebase) on the use of Node.js that would allow for exactly this functionality.

Monitoring a Folder for Changes in Files and Folders with Node.js[^]

Take a look at the DirectoryWatcher fileChanged event, I think it is exactly what you're looking for. I haven't tested this, so please let me know how this works out for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900