开发者

Check directory's sharing mode in windows

My question is seems to be simple, but google is silent. I'm banned may be?:)

So the que开发者_StackOverflow中文版stion is can I check is there any blocked from deleting file in directory or it's subdirectories before delete it? Is there simple way to do it?


No, there isn't.

And even if there was, it wouldn't work. Consider this sequence of events:

  1. You perform the check and it succeeds (there is no blocked files).
  2. Another process receives CPU quantum and opens a file without FILE_SHARE_DELETE flag.
  3. Your process gains the CPU back and proceeds to delete the directory -- only to discover that it can't, because now there is a blocked file.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜