title: How to lock a file in linux/unix by a java program?
body: <p>I need to lock a file in unix/linux OS. I have googled and read about <code>java.nio.channels Filelock</code> and <code>Reentrant File Lock</code> . But both works in Windows but not in unix. Is there any other way of implementing a lock on file in unix? Any sample code would be highly appreciated.</p>
  
  <p>Thanks,
  Vignesh</p>