title: fileChannel.lock not working expectedly
body: <p>I am using <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/channels/FileChannel.html#lock%28long,%20long,%20boolean%29" rel="nofollow"><strong><code>fileChannel.lock(long position, long size, boolean shared)</code></strong></a> to get an exclusive access of a particular portion of the file. The exact code is:</p>
  
  <pre><code>fileChannel.lock(3458, 128, false);
  </code></pre>
  
  <p>But unfortunately when i am trying to change something any where in the file from a different process it is throwing exception saying that the file is locked. But my expectation was it should allow me to change any part of the file apart from the portion which i have locked. </p>
  
  <p>Can somebody help me in finding what am i doing wrong?</p>
  
  <hr>
  
  <p>Some of the details about my setup:</p>
  
  <p><strong>OS details:</strong></p>
  
  <pre><code>Mac OS X Lion 10.7.5
  </code></pre>
  
  <p><strong>Processes details:</strong></p>
  
  <ol>
  <li>java process which locks the particular portion of the file</li>
  <li><strong>TextWrangler</strong> which tries to change the file in different portion than that of the locked portion. But it fails.</li>
  </ol>