Is there a limit on number of open files in Windows(Windows 中打开文件的数量是否有限制)
问题描述
我在 VC++ 中用 fopen() 打开了很多文件,但过了一会儿就失败了.
可以同时打开的文件数量有限制吗?
C 运行时库对可以在任何时间打开的文件数有 512 个限制.尝试打开超过最大数量的文件描述符或文件流会导致程序失败.使用 _setmaxstdio 更改此数字.有关这方面的更多信息可以在此处 中阅读>
此外,您可能还需要检查您的 Windows 版本是否支持您尝试使用 _setmaxstdio 设置的上限.有关 _setmaxstdio 的更多信息,请查看此处
可以找到与 VS 2015 对应的主题的信息 这里
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?
The C run-time libraries have a 512 limit for the number of files that can be open at any one time. Attempting to open more than the maximum number of file descriptors or file streams causes program failure. Use _setmaxstdio to change this number. More information about this can be read here
Also you may have to check if your version of windows supports the upper limit you are trying to set with _setmaxstdio. For more information on _setmaxstdio check here
Information on the subject corresponding to VS 2015 can be found here
这篇关于Windows 中打开文件的数量是否有限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Windows 中打开文件的数量是否有限制
基础教程推荐
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- CString 到 char* 2021-01-01
- 初始化列表*参数*评估顺序 2021-01-01
