views:

56

answers:

4

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)?

+1  A: 

Something like this might beof use...

Martin Milan
+2  A: 

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

Andrew Aylett
A: 

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.

kyoryu
Keeping track of your own files doesn't help much if you are looking for the system total.
Martin Wickman
@wic: True, but the question was about keeping track of what files the app, not the system, had opened.
kyoryu
+1  A: 

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

h0b0