Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Too many files open" error in DOS

736 views
Skip to first unread message

Malcolm Sharp

unread,
Oct 29, 1992, 1:11:31 PM10/29/92
to

We've developed an MS-DOS-based FORTRAN program that has given the
error message "Too many files open." This occurs when we the program
is attempting to open the 16th file. We have editted the 'CONFIG.SYS'
file "FILES= " statement to be 30, 40, ... 60 files to no avail (and of
course rebooted after making the change).

Any ideas suggestions will be appreciated.

Malcolm Sharp
U of SoCal


Dave Tholen

unread,
Nov 1, 1992, 6:25:51 PM11/1/92
to
Malcolm Sharp writes:

I believe that FORTRAN allows a maximum of 20 open files. The system
already opened standard input, standard output, standard error, standard
printer, and standard auxiliary for you, so it makes sense that your
program dies when it attempts to open the sixteenth file. I also believe
that is some sort of system call you can make to reset the maximum number
of open files. Check your documentation. This setting is independent of
the FILES= statement in CONFIG.SYS. Obviously, it will also need to be
set to a higher value, but you already know that.

Oh, and when I say FORTRAN allows a maximum of 20 open files, I mean DOS
FORTRAN, not the ANSI standard.

Kevin Kitsemetry

unread,
Nov 6, 1992, 9:21:05 AM11/6/92
to

This is specific to the compiler that you are using. Some, such as
WATCOM FORTRAN 77 & FORTRAN 77/386, will allow you to increase this
limit.

Billy G. Allie

unread,
Nov 8, 1992, 11:38:23 AM11/8/92
to
sh...@mizar.usc.edu (Malcolm Sharp) writes:

Changing the "FILES=" parameter in CONFIG.SYS changes the number of system
wide file handles that are available. But, the problem is that MS-DOS
limits the number of open files per process to twenty (20), five (5) of
which are pre-opened by COMMAND.COM for the process before it starts.
Given this fact, you will be able to open fifteen (15) additional files
before running out of 'per process' file descriptors. There are ways
around this limit that involves running a program that increases the per
process limit and then executes the program that needs the increased
limits. If you are interested in the details, send me E-mail, and I will
dig up the detailed information to send to you. Be sure to include the
version of MS-DOS you are using.

BTW: The five (5) pre-opened files are 'stdin', 'stdout', 'stderr',
'stdaux', and 'stdprn'
--
____ | Billy G. Allie | Domain....: b...@bgalli.eds.com
| /| | 7436 Hartwell | UUCP......: uunet!edsews!bgalli!bga
|-/-|----- | Dearborn, MI 48126 | Compuserve: 76337,2061
|/ |LLIE | (313) 582-1540 | Genie.....: BGALLIE

0 new messages