|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『楼 主』:
WinXP命令行下的DOS对同时打开文件数也有限制!
使用 LLM 解释/回答一下
用下面的一断代码做了一个实验,发现WinXP命令行下的DOS对同时打开文件数也有限制!我的XP只能同时再打开15个文件.
如果在纯DOS下面、Win9X下面可以修改c:\Config.Sys文件的FILES=??解决,XP下如果解决呢!
void MyDebug()
{
int i;
char buf;
FILE* psFile;
for (i = 0; i < 20; i++)
{
sprintf(buf, "Abcde-%02d.Txt", i + 1);
psFile = fopen(buf, "a+b");
}
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile );
psFile= NULL;
}
}
getch();
return;
}
执行结果是:
File01::75BF71CE
File02::75BF71E2
File03::75BF1F6
.....
File14::75BF72D2
File15::75BF72E6
File16::00000000
File17::00000000
File18::00000000
File19::00000000
File20::00000000
Last edited by firstsail on 2010-1-28 at 19:13 ]
I did an experiment using the following code and found that DOS under WinXP command line also has a limit on the number of simultaneously opened files! My XP can only open 15 files simultaneously.
If under pure DOS or Win9X, you can solve it by modifying the FILES=?? in the c:\Config.Sys file. How to solve it under XP!
void MyDebug()
{
int i;
char buf;
FILE* psFile;
for (i = 0; i < 20; i++)
{
sprintf(buf, "Abcde-%02d.Txt", i + 1);
psFile = fopen(buf, "a+b");
}
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile );
psFile= NULL;
}
}
getch();
return;
}
Execution result is:
File01::75BF71CE
File02::75BF71E2
File03::75BF1F6
.....
File14::75BF72D2
File15::75BF72E6
File16::00000000
File17::00000000
File18::00000000
File19::00000000
File20::00000000
Last edited by firstsail on 2010-1-28 at 19:13 ]
|
|
2010-1-28 09:40 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2010-1-28 18:45 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
修改我的c:\WindowXP\System32\Config.NT文件
我将文件里面的Files=40改成Files=60后重新启动计算机,执行同样的代码还是原结果,没有达到预期目的!
执行结果是:
File01::75BF71CE
File02::75BF71E2
File03::75BF1F6
.....
File14::75BF72D2
File15::75BF72E6
File16::00000000
File17::00000000
File18::00000000
File19::00000000
File20::00000000
Modify my c:\WindowXP\System32\Config.NT file
After I changed Files=40 to Files=60 in the file and restarted the computer, executing the same code still gave the original result, which did not achieve the expected purpose!
Execution result is:
File01::75BF71CE
File02::75BF71E2
File03::75BF1F6
.....
File14::75BF72D2
File15::75BF72E6
File16::00000000
File17::00000000
File18::00000000
File19::00000000
File20::00000000
|
|
2010-1-28 19:07 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
贴子显示怎么不正常
明明是这样
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile);
psFile= NULL;
}
}
怎么显示成
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile);
psFile= NULL;
}
}
将"第一楼贴子"拷贝到"记事本"程序里面,看到的情况是正常的,但眼睛看到的情况切是第二种情况,难道有病毒不成???
Last edited by firstsail on 2010-1-28 at 19:18 ]
Why is the post display abnormal?
It is clearly like this:
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile);
psFile= NULL;
}
}
How did it display as:
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile);
psFile= NULL;
}
}
Copying "the first-floor post" into the "Notepad" program, the situation seen is normal, but the situation seen with the eyes is the second situation. Could it be that there is a virus???
Last edited by firstsail on 2010-1-28 at 19:18 ]
|
|
2010-1-28 19:15 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
明明是这样
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile[i]);
if (NULL != psFile[i])
{
::fclose( psFile[i]);
psFile[ i ]= NULL;
}
}
怎么显示成
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile);
psFile[ i ]= NULL;
}
}
发现是修改贴子后,就会有这样现象,怪!
It clearly is like this
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile);
psFile= NULL;
}
}
How it shows as
for (i = 0; i < 20; i++)
{
printf("\nFile%02d::%08lX", i + 1, (unsigned long)psFile);
if (NULL != psFile)
{
::fclose( psFile);
psFile= NULL;
}
}
Found that after modifying the post, there will be such a phenomenon, strange!
|
|
2010-1-28 19:20 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2010-1-28 19:35 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2010-1-28 19:43 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
我在我的XP下只有CMD,没有COMMAND
I'm under my XP, there's only CMD, no COMMAND
|
|
2010-1-30 18:27 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2010-2-3 18:47 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
我安装的WinXP是用¥300大洋买来的正版软件安装的!
The WinXP I installed was installed using a genuine software that I bought for 300 yuan!
|
|
2010-2-6 11:55 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2010-2-6 22:51 |
|