Скачать Extend 6.0 - Open More Files than DOS Standard 20

Скачать файл (15,53 Кб)

Version 6
November 30, 1992
by Scott Bussinger
Compuserve 72247,2671
  MS-DOS and PC-DOS Turbo Pascal 3.0 and higher only allow up to 15 files to
be open at the same time, due to limitations in DOS.  This file shows you how
to have up to 96 files open simultaneously under DOS 2.0 or 2.1, or 252 files
open simultaneously under DOS 3.0 or higher.  Below is a description of how to
use this technique, followed by a technical explanation of the implementation,
for those who are interested.  Note this documentation is liberally based on
the original EXTEND.PAS documentation by Randy Forgaard, but has been renamed
to EXTEND.DOC and modified by Scott Bussinger to reflect the changes to
involved in versions 2 and 3.


  You simply include the EXTEND unit in the USES statement in the source code
of your main program.  You will have to either compile the EXTEND unit
separately or use Turbo Pascal 4.0's project compiling features to Make or
Build your program (which will compile the EXTEND unit automatically).  The
EXTEND unit should be the first unit in your USES statement, following only
the DOS unit (which is USEd by the EXTEND unit).  The unit automatically
installs itself and will uninstall itself when your program ends or an error
is detected.  See the demo program below for an example of using the EXTEND

  The EXTEND.PAS file will need to be available available to be compiled if
the Make or Build features are used to compile the program.  The EXTEND.ASM
is the source code for the assembly language interrupt handler used when
running under DOS 2.  The EXTEND.OBJ file is the assembled object code for
EXTEND.ASM and was compiled using A86, a shareware compiler available on
Compuserve and other bulletin boards.

  You must edit your CONFIG.SYS file (see the DOS manual for details), so
that it includes a line that says "FILES=XXX".  XXX should be a number that is
at least 3 greater than the maximum number of files that will be in use
(opened by RESET, REWRITE or APPEND) at the same time during the execution of
your program (larger values will provide no additional benefit, with respect
to your individual program), and should not exceed 99 (for DOS 2.0/2.1) or 255
(for DOS 3.0 and higher).  Under any version of DOS, the minimum allowable
value for XXX is 8.  Then, reboot your computer so that the FILES=XXX
parameter takes hold.  This same change to the CONFIG.SYS file will have to be
made on any machine in which your program is to run.

  Running the sample program will tell you the
maximum number of files you can have open at once (usually 3 less than the
number of files specified in the CONFIG.SYS file as discussed above, unless a
resident program has opened some files and hasn't closed them yet).