Jump to content

derekm22098

New Members
  • Posts

    1
  • Joined

  • Last visited

derekm22098's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I have an EXE app on my home server that uploads a .txt file (live lightning strikes) every 1 minute to my web server. Then I use this PHP code to read the text file and load it into their software (like Google Earth) where it displays it visually on the map. I'm using PHP to hide public view of strikes(us).txt file as they will scrape the data. My issue is, sometimes the software calls the PHP file which reads the .txt file and it's still being written to, not fully complete, which fails in the software. How can I use PHP to determine if this file is not open, being written to, or incomplete and either wait 2 seconds and try again or something alike. Thank you for any help. <?php header('Content-Type: text/plain'); if (preg_match('/(GRLevel2|GRLevel3|GR2Analyst)/', $_SERVER['HTTP_USER_AGENT'])) { echo file_get_contents( "Strikes(US).txt" ); } else { echo 'Please Copy & Paste the URL directly into your GRLevelX Placefile Manager!'; exit; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.