pgb
New Member
Greetings
I'm trying to resolve a little puzzle with Borland TurboC 2.01 - how many files can a program have open at the same time?
I have the Reference Guide and User's Guide (books); if the answer's in either of these it must be hiding very well (!)
Looking in <stdio.h> I find
Have tried using open() and tried using fopen() - same behaviour in each case.
(testing in various environments including "pure" DOS 6.22)
so, I've looked to the DOS environment and set files=20, fcbs=20, set all sorts of things which I thought might have a bearing - still can only have 15 files open before getting errors.
I tried "tweaking" the value in <stdio.h> to see whether that would make a difference - it didn't. Which makes me suspect that the limitation is coming from somewhere else...
What am I missing?
TIA, Peter.
I'm trying to resolve a little puzzle with Borland TurboC 2.01 - how many files can a program have open at the same time?
I have the Reference Guide and User's Guide (books); if the answer's in either of these it must be hiding very well (!)
Looking in <stdio.h> I find
which all seems quite clear... the only problem being, that it doesn't behave like that! Trying it out "for real" I get errors after 15 successful file opens (the 16th attempt gives the error)./* Number of files that can be open simultaneously
*/
#define OPEN_MAX 20 /* Total of 20 open files */
#define SYS_OPEN 20
Have tried using open() and tried using fopen() - same behaviour in each case.
(testing in various environments including "pure" DOS 6.22)
so, I've looked to the DOS environment and set files=20, fcbs=20, set all sorts of things which I thought might have a bearing - still can only have 15 files open before getting errors.
I tried "tweaking" the value in <stdio.h> to see whether that would make a difference - it didn't. Which makes me suspect that the limitation is coming from somewhere else...
What am I missing?
TIA, Peter.