title: why cp fails to copy /proc/stat file?
body: <p>In my linux machine if i try to copy /proc/stat it is creating 0 byte file.
  but if i do cat /proc/stat it has data. but the size always shows as 0. </p>
  
  <pre><code> cp /proc/stat statfile
  </code></pre>
  
  <p>is creating zero byte file.
  If i write a program to copy then it worked. why is it so ?</p>
  
  <pre><code>  int main() 
    {
      std::ifstream procFile("/proc/stat");
      std::ofstream outfile("statfile");
      char buf[1024];
      while (!procFile.eof() &amp;&amp; procFile.is_open())
      {
              procFile.getline(buf, 1024);
              outfile &lt;&lt; buf&lt;&lt;endl;
      }
  
      procFile.close();
      outfile.close();
      return 0;
    }
  </code></pre>