阅读背景:

如何使用java锁定文件(如果可能)

来源:互联网 

I have a Java process that opens a file using a FileReader. How can I prevent another (Java) process from opening this file, or at least notify that second process that the file is already opened? Does this automatically make the second process get an exception if the file is open (which solves my problem) or do I have to explicitly open it in the first process with some sort of flag or argument?I have a Java process that opens a file using a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: