So I have a piece of hardware that collects a mess of data and writes it as binary data to some file as per some configuration. Could be local to the machine, but probably written to some shared NFS.
Also, the system has Apache and serves up some status and configuration pages. I'm developing an app that displays the binary data as a bunch of time series stripcharts. Herein lies the question... What is the best way to read a binary file from a NFS?
The current solution has a PHP script read the file, unpack the binary, and send the data as JSON to the client. This of course has enormous overhead, and since resources are limited, I need to remove the Apache machine from the flow. So how might I read a binary file (using HTML5 FileReader) from a NFS?
Javascript (running in a browser) is not generally allowed access to operating system files, for security reasons.
However, have a look here:
Reading Files in Javascript using the File API's
http://www.html5rocks.com/en/tutorials/file/dndfiles/