开发者

Check directory's sharing mode in windows

开发者 https://www.devze.com 2023-02-13 15:45 出处:网络
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 s

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

精彩评论

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