阅读背景:

等待文件锁被释放

来源:互联网 

There are some Java questions similar to this one but none of them had accepted answers that I could find and my situation is a little more specific. I have a program that processes files one at a time as they are fed into a directory. At times, the files may remain locked in use by the program dropping them off for a few seconds after they've are visible to my program. I have no control over that program. In my program I already have error handling to recover if a file is in use when my program tries to read it. It results in the file being skipped entirely. What I want to implement is a retry scheme to see if the file becomes unlocked after a few seconds. In another question here I found a suggestion to use There are some Java questions similar to this o




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

分享到: