title: How do I seek beyond end of existing file?
body: <p>how do I seek beyond end of existing file ?</p>
  
  <p>Consider I have <code>test.bin</code> which is 1000 bytes.</p>
  
  <p>Then I run following</p>
  
  <pre><code>std::filebuf fbuf;
  fbuf.open("c:\\test.bin", std::ios_base::in | std::ios_base::out | std::ios_base::app | std::ios_base::binary);
  fbuf.pubseekoff(10, std::ios_base::end);
  fbuf.sputc(1);
  fbuf.close();
  </code></pre>
  
  <p>After running this example I expect new filesize to be 1011 bytes. But instead it adds 0x01 at the end of existing file making it 1001 bytes.</p>
  
  <p>Interestingly though it works the way I want it when it's new file.</p>
  
  <p>I'm running this on Windows 7 x64 but target platform will be Ubuntu.</p>