title: Haxe Asynchronously Read Local File?
body: <p>I need to do IPC with another app. That app sends data and my Haxe app receives. For some reason my choice narrows down to the file system. </p>
  
  <p>My idea is to have the other app keep updating a file, and my Haxe app keeps reading from that file. The problem is I keep getting the same value, although the data file is changing. I assume I need some asynchronous reader to get the updated file, but what should I use?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>var tmpWaveRaw = sys.io.File.getContent("assets/wave.txt");
  trace(tmpWaveRaw); //always stays the same when the app is running, but changes when the app restarts.
  </code></pre>
  
  <p>Thanks!</p>
  
  <p><strong>Update:</strong>
  Here's an experiment I just did:</p>
  
  <ol>
  <li>Have my code keeps printing modified time of the file every 100ms.</li>
  <li>Let the other application modify the file and stop.</li>
  <li>Start my application. Now it's printing the correct modified time, and it is consistent with my OS's file stat.</li>
  <li>Let the other application modify the file again. Close.</li>
  <li>My application still prints the old modified time, not consistent with my OS's file stat.</li>
  </ol>