Mail Archives: djgpp/1996/03/12/09:56:14
Hi,
Some days ago I asked how to open more than 45 files, or how to open
the same file more than 45 times. I did my first trials under
Windows95 (DOS boxes), but not reaching a solution, I have repeated
in DOS 6.2 and in Windows 3.11 (DOS boxes) and the result is the same:
if the FILES parameter is low (for example FILES=10) this is the limit,
but if it is high (for example FILES=200) I receive an error when
opening the the 45th file in DJGPP and the 15th file in TC 2.0.
The 45-15 limit persists in the three evironments (Win95, Win 3.x
and DOS).
I really need to bypass this limit, so any idea will be very much
apreciated. Thank you very much and excuse me for the insistence.
Following is a simple code that produces the problem.
Xavier Pons
/* ------------------------------------------------- */
#include <stdio.h>
#include <stdlib.h>
#define MAX_FILES_TO_OPEN 200
int main (int argc, char * argv[])
{
FILE *pf[MAX_FILES_TO_OPEN];
short int i;
for (i=0; i< MAX_FILES_TO_OPEN; i++)
{
if ((pf[i]=fopen("c:\\config.sys", "rb"))==NULL)
{
printf ("\nCannot open file (index = %hd)", i);
exit(1);
}
}
puts ("Success!");
exit (0);
}
- Raw text -