title: Truncating an existing fstream that has been locked by boost::interprocess
body: <p>What would happen if I <strong>reopen</strong> an <code>fstream</code> with data in it using the <code>std::ios::trunc</code> flag without closing a process and whilst my process holds a <code>boost::interprocess::file_lock()</code>?</p>
  
  <p>Should I expect the OS to maintain my file lock? Or will the OS transparently unregister the lock when the file is closed? Both Windows and POSIX experience would be appreciated.</p>
  
  <p><strong>edit</strong> </p>
  
  <p>my main goal is to truncate a config file and rewrite it. The secondary purpose of the file is to prevent other equivalent daemons from starting up. So if there is another way using boost or c++ stl to truncate a file without closing it, I'm all ears :D </p>