如何检查我在 Windows 上打开了哪些文件?

发布于 2024-08-25 22:37:07 字数 138 浏览 3 评论 0原文

当尝试执行 fopen(C++、Windows XP)时,我收到“打开文件过多”错误。 可能发生这种情况是因为我在程序中的某个地方打开了文件而不关闭它们。

Windows 上有没有办法查看所有打开的文件描述符(或我的程序打开的所有文件)的列表?

I received a "Too many open files" error when tried to do fopen (C++, Windows XP).
Probably it happened because somewhere in my program I open files without closing them.

Is there a way on Windows to see a list of all open file descriptors (or all files that my program fopened)?

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

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

发布评论

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

评论(4

时光磨忆 2024-09-01 22:37:08

您可以在 Process Explorer 中找到打开句柄的列表。您还可以搜索系统中所有打开的句柄。

You can find a list of open handles in Process Explorer. You can also search all open handles in the system.

败给现实 2024-09-01 22:37:08

这个之类的东西可能有用......

Something like this might beof use...

你げ笑在眉眼 2024-09-01 22:37:08

在这种情况下,我的选择是 Sysinternals Process Explorer

My choice in such a case is the Sysinternals Process Explorer.

屋顶上的小猫咪 2024-09-01 22:37:08

与其寻找 Windows API 来做这件事,为什么不自己跟踪它呢?编写一些函数来为您执行打开和关闭操作,并在调用它们时跟踪打开和/或关闭的内容。

你有这些信息,所以尝试从其他来源获取它对我来说似乎没有什么意义。

Rather than look for a Windows API to do it, why not keep track of it yourself? Write some function to do the opening and closing for you, and when they're called, keep track of what is opened and/or closed.

You have the info, so trying to get it from another source seems to make little sense to me.

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