try {/简让/ if the lock was null, anthor program was locking the file.
lock=new FileOutputStream(new File(lockPath)).getChannel().tryLock()
} catch (Exception e) {
return false
}
/兆贺/族咐派 do not close stream or file will be unlocked
return lock==null
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)