China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 00:07
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » There are also limits on the number of files that can be opened simultaneously in DOS under WinXP command line! View 2,445 Replies 10
Original Poster Posted 2010-01-28 09:40 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
21-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
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 ]
Floor 2 Posted 2010-01-28 18:45 ·  中国 上海 杨浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Try modifying windows\system32\config.nt?
Floor 3 Posted 2010-01-28 19:07 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
21-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
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
Floor 4 Posted 2010-01-28 19:15 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
21-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
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 ]
Floor 5 Posted 2010-01-28 19:20 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
21-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
It clearly is like this
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;
}
}

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[ i ]= NULL;
}
}


Found that after modifying the post, there will be such a phenomenon, strange!
Floor 6 Posted 2010-01-28 19:35 ·  中国 上海 杨浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
It is estimated that it is caused by the conflict between the [i] variable in your code and the [i] code in Discuz! code, resulting in font deformation.
Solution
Method 1: Check "Disable Discuz! Code" when posting
Method 2: Add [code][/code] Discuz! code at both ends of the code you post
Floor 7 Posted 2010-01-28 19:43 ·  中国 上海 杨浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Are you under CMD or COMMAND? It seems that config.nt and autoexec.nt are only effective for COMMAND.
Floor 8 Posted 2010-01-30 18:27 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
21-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
I'm under my XP, there's only CMD, no COMMAND
Floor 9 Posted 2010-02-03 18:47 ·  中国 上海 杨浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Could it be that you're also using that modified version of Windows? A lot of things have been streamlined?
Floor 10 Posted 2010-02-06 11:55 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
21-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
The WinXP I installed was installed using a genuine software that I bought for 300 yuan!
Floor 11 Posted 2010-02-06 22:51 ·  中国 上海 杨浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Haha! If that's the case, then you can go to the person who sold you the software to settle the account: Why doesn't my Windows XP have COMMAND? What kind of XP did you sell me!
Forum Jump: