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.
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.
- relates to
-
JDK-4495729 (fs) FileChannel.lock/tryLock require read access to get an exclusive lock
-
- Resolved
-
-
JDK-4510562 (fs spec) FileChannel.lock/tryLock spec should describe channel preconditions
-
- Closed
-