阅读背景:

如何判断捕获的IOException是否是由另一个进程使用的文件引起的,而不需要解析异常的Message属性

来源:互联网 

When I open a file, I want to know if it is being used by another process so I can perform special handling; any other IOException I will bubble up. An IOException's Message property contains "The process cannot access the file 'foo' because it is being used by another process.", but this is unsuitable for programmatic detection. What is the safest, most robust way to detect a file being used by another process?When I open a file, I want to know if it is bei




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

分享到: