如何检查我在 Windows 上打开了哪些文件?
当尝试执行 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以在 Process Explorer 中找到打开句柄的列表。您还可以搜索系统中所有打开的句柄。
You can find a list of open handles in Process Explorer. You can also search all open handles in the system.
像这个之类的东西可能有用......
Something like this might beof use...
在这种情况下,我的选择是 Sysinternals Process Explorer。
My choice in such a case is the Sysinternals Process Explorer.
与其寻找 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.