I have a PHP file that writes a significant amount of data to a “dump” file, then I am using Jquery to $('#element').load() that data from my user interface page. The problem is that I am creating this dump file on the fly and as more and more of the dump file contents are added, every few seconds my Jquery loads that data again. This works fine most of the time. The problem arises when the read happens, while the file is being written to. This halts my PHP script. I check in PHP with is is_writable() to make sure the file is available but is there a “is_readable()” type of function for JavaScript/Jquery? I know that I could create an “intermediate” PHP file to check, but that would require a significant amount of change to do, is there an easy way to check in JavaScript?
I have a PHP file that writes a significant amount of data to a
Share
Ending up having to use an intermediary php file that waits for the dump file to become available before trying to read from it, then just echos the contents