title: how to open a file in C (fopen/fread)
body: <p>I have an embedded board (beagleboard-xm) that runs ubuntu 12.04, I would like to read one GPIO input if it is logic 1 or 0. How can I implement <code>cat /sys/class/gpio/gpio139/value</code> in C? (<strong>value</strong> file stores 0 or 1)<br>
  I open the file by:</p>
  
  <pre><code>FILE *fp;
  fp = fopen("/sys/class/gpio/gpio139/value", "rb");
  </code></pre>
  
  <p>what do I need to do next?</p>