java.io.IOException: Bad file number
is thrown when lock(), tryLock(), lock(0,size,false) and tryLock(0,size,false) are called. (Since for lock() and tryLock() default lock is exclusive)
try {
File blah = new File("blah");
FileInputStream fis = new FileInputStream(blah);
FileChannel c = fis.getChannel();
FileLock fl = c.tryLock(0,c.size(),false);
//FileLock fl = c.tryLock(0,c.size(),true);
} catch (Exception e) {
e.printStackTrace();
}
###@###.### 2001-10-03
Implementation part has been done, but the spec for lock(), trylock() has not
been updated to reflect the same. Therefore removing this bug from the Integrated state.