Is there a limit on number of open files in Window

2019-01-01 15:56发布

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?

标签: c++ windows
7条回答
墨雨无痕
2楼-- · 2019-01-01 16:42

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.

查看更多
登录 后发表回答