开发者

How to check which files I fopen'ed on Windows?

I received a "Too many open files" error when tried to do fopen (C++, Windows X开发者_JS百科P). 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)?


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...


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


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜