For every C/C++ programmers, fopen may be one of the most familiar functions. Taking myself as instance, I used to use it quite freely, as it's free lunch. But there's no free food ever -- the FILE* number you open at the same time in one single process cannot surpass 512 as default. It's no larger than 2048 even with _setmaxstdio()'s help.
See? This constraint is so covert & hard to find in a large project -- it's been cost 2 days or more on two people, including me.
We'll definitely meet many submerged rocks while devoting yourself to large projects. Many of these hide in the corner you thought it's always been safe and which is not, and some just come from the place outside your code of the projects.
So, take care~

本文探讨了C/C++编程中fopen函数的一个常见误区:文件句柄数量限制。作者通过亲身经历揭示了当同时打开大量文件时可能遇到的问题,并提醒开发者注意这一隐藏的限制。
1734

被折叠的 条评论
为什么被折叠?



