home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / streams / handles / readme < prev    next >
Encoding:
Text File  |  1992-04-08  |  7.1 KB  |  145 lines

  1.  
  2.       *************  READ THIS FILE FIRST *************
  3.  
  4. This archive contains a tiny package of files designed to extend the
  5. number of handles available to a program compiled with Turbo C.
  6.  
  7. With a fully installed system you will be able to:
  8.   (a) Get more than 240 handles under Turbo C and/or DJGPP.
  9.   (b) Use all of these in streams under DJGPP or BCC++ 3.0 if you want,
  10.       but only up to 20 under earlier versions of Turbo C  :-(
  11.  
  12. As of 30th March 1992 it has been tested successfully with Turbo C v1.5,
  13. Turbo C++ v1.0, Borland C++ v2.0, and Borland C++ v2.0. I have examined
  14. the library object code for Turbo C v1.0 (the original version of Turbo C)
  15. and found no essential differences. It therefore is fairly certain that it
  16. will work with all versions of Turbo C up to and including Borland C++ v3.0.
  17. If you have a later version and try this package I would ask you to email
  18. me the results, please.
  19. What is less certain is the effect of enhancements or extensions to MS-DOS
  20. such as QEMM, etc. There is some evidence that the maximum number of files
  21. available under some such extensions may be less than 128.
  22.  
  23.  
  24. INSTALLATION:
  25. I recommend that you follow all of the steps below. However, if you
  26. are brave then go to step (9) if you just wish to use this package
  27. with DJGPP and are happy to skip the preliminary tests.
  28.  
  29. (1) Extract the files of the package into a convenient directory
  30. (you have probably done this already).
  31.  
  32. (2) If you wish to use a version of Turbo C which is earlier than
  33. Turbo C++ v1.0, then you will need to edit "makefile" (there is a
  34. section of "makefile" with notes to help you).
  35.  
  36. (3) Change to the directory which contains the files from this package
  37. and type "make". Turbo C will produce an executable called "test2.exe".
  38. You will probably get a warning message when "test2.c" is compiled,
  39. ignore it.
  40.  
  41. (4) Edit your config.sys file so that you have a files=nn statement where
  42. nn is greater than 20. I suggest setting it to 255 (which is the largest
  43. possible value under MSDOS 5.00). Re-boot your system to make the change
  44. effective.
  45.  
  46. (5) To run test2.exe, you will need a bit more than nn*2 kB of free disk
  47. space to hold all of the files which will be simultaneously opened. (Note:
  48. this assumes a cluster size of 2 kB, which seems to be the usual size for
  49. a hard disk). (Warning: the root directories of drives in MS-DOS have a
  50. fixed limit on the number of files which they may contain. It is possible
  51. to exceed this number, particularly on floppy disks. Therefore you should
  52. normally run test2.exe in a subdirectory, but no damage should occur if
  53. you run it in a root directory - you might simply create fewer files than
  54. you expect). If you are using BCC++ 3.0, twice as many files will be created
  55. by test2.exe, so you need twice as much disk space to hold the files.
  56.  
  57. (6) Run test2.exe:
  58.                    test2 -d
  59. The -d switch causes test2.exe to report its progress as it goes through
  60. a series of tests. When it finishes you should find a lot of files with
  61. names of the form "fd_nnn.$$$" where nnn ranges from 000 to 251 (i.e.
  62. 252 files). Check that each file has a size of 25 bytes. Examine the
  63. contents of one or two of these files, they should be different but almost
  64. the same. Delete all of these little test files.
  65.  
  66. (7) If this ran with no apparent problems, try re-directing the output of
  67. test2.exe to a file:
  68.                    test2 -d >results
  69. You should notice that you get one less handle than when you ran test2.exe
  70. without re-direction. (You will also get one less "fd_nnn.$$$" file).
  71.  
  72. (8) You can use this scheme with any Turbo C program simply by either
  73.    (i) If you use the default "close.c" and are using a version of Turbo C
  74.        which is at least Turbo C++ v1.0, then you just need to link 
  75.        close.obj into your .exe file. That's all!
  76.    (ii) If you remove the "#pragma startup" statement from "close.c" (or
  77.        you are using a version of Turbo C which is earlier then Turbo C++
  78.        v1.0) then you will need to include a statement
  79.                increase_handles();
  80.        somewhere in your program, before the program tries to use all of
  81.        those handles (preferably early in main()). You will need to link
  82.        close.obj (compiled with the appropriate model) with your program.
  83. If you are careful to avoid loading the original CLOSE module from the
  84. Turbo C libraries, then you can avoid the explicit loading of close.obj
  85. by placing it in a library.
  86.  
  87. (9) The original purpose of this package was to increase the number of handles
  88. available with DJGPP v1.05. All you need to do is (assuming that you are
  89. using a version of Turbo C which is at least Turbo C++ v1.0):
  90.       (i)   Copy the file "close.c" to your go32 source directory.
  91.       (ii)  Apply the file go32.dif to that directory.
  92.       (iii) Re-compile go32.
  93.       (iv)  Save or delete the old go32.exe and install the new go32.exe
  94.             in a directory in your PATH.
  95.    Notes:
  96.    (a) This will not increase the number of streams which are available
  97.     under DJGPP to the same extent, but only minor changes are needed to do
  98.     this too! See the file "streams.doc" in this package.
  99.    (b) If you are using a version of Turbo C which is earlier than Turbo C++
  100.     v1.0 then you will probably also need to edit the file "control.c" in
  101.     the go32 source directory and add "increase_handles();" as the first
  102.     statement in main().
  103.  
  104. (10) See the file "handles.doc" for some information about handles in
  105. MSDOS and Turbo C.
  106.  
  107. (11) If you need to investigate "missing" handles, programs such as INFOPLUS
  108. will prove useful. The second part of page 9 (for version 150) of INFOPLUS
  109. gives a list of all files which are currently open, and identifies the
  110. program which has each one open. INFOPLUS is available from SIMTEL in the 
  111. <MSDOS.INFO> directory (as IFP1Pxxx.ZIP where xxx is the version number).
  112.  
  113. (12) Enjoy!
  114.  
  115.  
  116.  
  117. NOTES on testing: This package has been tested with Turbo C++ v1.0
  118. and PC-DOS 2.10, MS-DOS 3.10 and MS-DOS 5.00. It will not supply more
  119. than 20 handles under PC-DOS 2.10 (the necessary support for more than
  120. 20 handles requires DOS >= 3.0). It works with MS-DOS 3.10 provided that
  121. the option which uses DOS service 0x67 is not selected (service 0x67
  122. requires DOS >= 3.3). It has also been tested less thoroughly with Turbo
  123. C v1.5. Others have tested it with Borland C++ v2.0, and Borland C++ v3.0.
  124. Thanks to those people who have helped by testing the code on Borland C++,
  125. Stephen Herb <F35HER%DHHDESY3.BITNET@DSYIBM.DESY.DE> for testing the code
  126. with BCC++ v2.0, and Steve Frampton (frampton@vicuna.ocunix.on.ca) for
  127. testing the code with BCC++ v3.0.
  128.  
  129.  
  130. COPYRIGHT: Like most people who write programs, I have simply built upon
  131. the work of others. I have no particular wish to restrict the use of
  132. anything in this package nor do I expect to profit from it. Use it in any
  133. way you like (except please do not claim that it is your own work!).
  134.  
  135.  
  136. WARRANTY: There is none, of course. I know of no reason why this software
  137. could cause any loss of data, etc, etc. I accept no responsibility
  138. if there is any loss of any kind for any reason.
  139.  
  140.  
  141. 8th April 1992
  142.  
  143. W. Metzenthen
  144. apm233m@vaxc.cc.monash.edu.au
  145.