title: How to open file in exclusive mode in C++
body: <p>I am implementing some file system in C++. Up to now I was using <code>fstream</code> but I realized that it is impossible to open it in exclusive mode. Since there are many threads I want to allow multiple reads, and when opening file in writing mode I want to open the file in exclusive mode?<br>
  What is the best way to do it? I think <code>Boost</code> offers some features. And is there any other possibility? I would also like to see simple example. If it is not easy / good to do in C++ I could write in C as well.</p>
  
  <p>I am using Windows.</p>