Chinaunix首页 | 论坛 | 博客
  • 博客访问: 196915
  • 博文数量: 63
  • 博客积分: 1970
  • 博客等级: 上尉
  • 技术积分: 600
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-22 14:26
文章分类

全部博文(63)

文章存档

2013年(2)

2012年(11)

2011年(19)

2010年(6)

2007年(11)

2006年(14)

分类:

2007-04-02 16:31:18

 
win2000Serve sp4 VC6.0,已经运行了很长一段时间的一个服务,最近由于新增加了两个文件。
FILE fp[i] = fopen("a.dat","rb")(i=50)
一运行到此次就发生错误,,用GetLastError()捕捉代码w为“0”,fp[i] == NULL
 
msdn查到一些,如果用c函数库的话默认限制512,可以用函数_setmaxstdio修改到2048。如果用win32的系统函数的话我还没试,估计很高,正在看。是糊涂了,呵呵,没有分清除系统限制和具体函数库的限制
 
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.

 
 
"
 
阅读(1467) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~