Date: Tue, 12 Mar 1996 15:41:53 +0000 From: "x DOT pons AT cc DOT uab DOT es" Subject: Opening more than 45 files (again) To: djgpp AT sun DOT soe DOT clarkson DOT edu Message-Id: <01I298P2I6V600Q2G5@cc.uab.es> Organization: Universitat Autonoma de Barcelona Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT 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 #include #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); }