windows2000限制的一个进程最大打开文件个数是多少?

jzyangb 2005-08-11 06:47:24
据说是600多,不太清楚,有人能给个确切的答案吗?
据说是不能改的,有人知道怎么改的话帮忙说说方法吧。
谢谢啦。
...全文
378 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
nelsonc 2005-08-18
  • 打赏
  • 举报
回复
和你的内存有关。原则上没有限制。
jzyangb 2005-08-18
  • 打赏
  • 举报
回复
我在msdn查到一些,如果用c函数库的话默认限制512,可以用函数_setmaxstdio修改到2048。如果用win32的系统函数的话我还没试,估计很高,正在看。是我糊涂了,呵呵,没有分清除系统限制和具体函数库的限制(ps:也许现在的理解还是错的^-^)。

下面是msdn里对c函数库限制的解释

The _setmaxstdio function changes the maximum value for the number of files which may be simultaneously open at the stdio level.

C run-time I/O now supports many more open files on Win32 platforms than in previous versions. Up to 2,048 files may be open simultaneously at the lowio level (that is, opened and accessed by means of the _open, _read, _write, and so forth family of I/O functions). Up to 512 files may be open simultaneously at the stdio level (that is, opened and accessed by means of the fopen, fgetc, fputc, and so forth family of functions). The limit of 512 open files at the stdio level may be increased to a maximum of 2,048 by means of the _setmaxstdio function.

Since stdio level functions, such as fopen, are built on top of the lowio functions, the maximum of 2,048 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library.

Note This upper limit may be beyond what is supported by a particular Win32 platform and configuration.
i_noname 2005-08-18
  • 打赏
  • 举报
回复
写个循环自己测一下吧,我这是XP测不出2000的
DentistryDoctor 2005-08-18
  • 打赏
  • 举报
回复
一般来说,你不会突破这个限制吧???
我试过,一个进程的HANDLE超过9999,程序就出问题了。
所以:9999?
jzyangb 2005-08-18
  • 打赏
  • 举报
回复
用的时候再打开就慢了一些,我的是事先都打开的。
dirdirdir3 2005-08-12
  • 打赏
  • 举报
回复
你要同时打开那么多文件干什么?
可以异步处理啊,即需要的时候再打开。
zhangshengyu 2005-08-12
  • 打赏
  • 举报
回复
基本没有限制 知道核心内存用光了为止。
你看看WINDOWS内核代码就知道了。
masterz 2005-08-11
  • 打赏
  • 举报
回复
你可以自己写个程序试试啊,估计比600多

2,641

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧