I'm opening lots of files with fopen() in VC++ but after a while it fails.
Is there a limit to the number of files you can open simultaneously?
I'm opening lots of files with fopen() in VC++ but after a while it fails.
Is there a limit to the number of files you can open simultaneously?
In case anyone else is unclear as to what the limit applies to, I believe that this is a per-process limit and not system-wide.
I just wrote a small test program to open files until it fails. It gets to 2045 files before failing (2045 + STDIN + STDOUT + STDERROR = 2048), then I left that open and ran another copy.
The second copy showed the same behaviour, meaning I had at least 4096 files open at once.