問題描述
我在 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 中打開文件的數量是否有限制的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!