在Windows中打开文件的数量是否有限制 [英] Is there a limit on number of open files in Windows
问题描述
我在VC ++中使用fopen()打开了大量文件,但过了一会儿就失败了。
有多少文件可以打开同时?
C运行时库对于任何时候可以打开的文件数量有512个限制。尝试打开超过最大数量的文件描述符或文件流将导致程序失败。使用 _setmaxstdio
更改此数字。有关详情,请参阅此处 p>
此外,您可能必须检查您的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中打开文件的数量是否有限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!