拒绝访问目录/文件夹

发布于 2024-12-27 21:19:54 字数 173 浏览 1 评论 0原文

我只是浪费了一个小时左右来追这个。我能够解决它,但将其以问答形式希望其他人可能受益。

症状是我无法访问目录。我可以在资源管理器或命令窗口中浏览到它。我什至在属性窗口中看不到它的安全权限。

该文件夹是由我们的构建过程创建的,这意味着我几乎无法做任何工作。在网上搜索没有帮助。

回答如下。

I just wasted an hour or so chasing this. I was able to resolve it but putting it in q/a form hoping others might benefit.

The symptom was that I could not access a directory. I could browse to it in explorer or command window. I could not even see its security permissions in properties window.

The folder is created by our build process, which meant I could pretty much do no work. Searching on net was no help.

Answer below.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

断念 2025-01-03 21:19:54

事实证明,这与 cygwin 不锁定目录有关。构建过程删除了目录 (rmdir /su:\target),然后重新创建它 (mkdir u:\target)。我有一个 bash 窗口,其中该目录是当前目录。

当构建过程(bat 文件)调用 rmdir 时,它成功,甚至 %errorlevel% 为 0。但是后续的 mkdir code> 失败,访问被拒绝。。不幸的是,构建过程仅检查 rmdir 失败,而不检查 mkdir

感谢handle.exe,我发现该文件夹正在被bash.exe使用,从那里开始就很简单了。更改当前目录最终删除了该文件夹,然后再次构建,将一切设置正确。

我意识到这是 unix 行为,只有在所有处理文件都关闭后才删除文件,但它在 Windows 中的模拟有点不直观。

It turns out it has to do with how cygwin does not lock a directory. The build process removed the directory (rmdir /s u:\target) and then recreated it (mkdir u:\target). I had a bash window where that directory was the current directory.

When the build process (bat file) called rmdir it succeeded, even %errorlevel% was 0. However the subsequent mkdir failed with Access is denied.. The build process unfortunately checked only for rmdir failure, not mkdir.

Thanks to handle.exe I found the folder to be in use by bash.exe, From there it was straightforward. Changing the current directory finally deleted the folder and another go at build set everything right.

I realize this is unix behavior to remove a file only after all handled to it are closed, but its simulation in windows is somewhat non-intuitive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文