Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!bu.edu!husc6!genrad!jpn From: jpn@genrad.com (John P. Nelson) Newsgroups: comp.os.msdos.misc Subject: Re: Max files open Message-ID: <38897@genrad.UUCP> Date: 8 Oct 90 17:59:22 GMT References: <659@demott.COM> <1990Oct5.223922.2798@herald.usask.ca> Sender: news@genrad.UUCP Reply-To: jpn@genrad.UUCP (John P. Nelson) Organization: GenRad, Inc., Concord, Mass. Lines: 58 >>> No matter what I set "FILES=" in CONFIG.SYS >>>the maximum files that I can open is 15. Is there any way in which this >>>can be increased. >> >It also depends on your DOS version. Some versions of DOS (as recently >as 3.20) allow FILES=[>20] but in reality could only accomodate 20 >files. This answer is VERY misleading. Every version of DOS (at least since 2.0, I don't know about 1.0) allows you to set FILES greater than 20. This has no effect on the per-application file limit of 20: FILES is a system-wide parameter. The FILES parameter was primarily intended to allow more file descriptors on systems that use lots of TSRs or multitaskers. On the other hand, it has always (since DOS 2.0) been possible to increase the size of the per-task file descriptor limit, on a task by task basis. The per-task limit of 20 files is caused by the fact that the default file descriptor table is located in the PSP, which itself is a fixed length item. However, the PSP contains both the fixed-length table, and a pointer to that table (and a length variable). It is possible to create a larger task file descriptor table by 1. allocating a block of memory for it, 2. copying the contents of the fixed-length file descriptor table from the PSP, 3. changing the pointer in the PSP to point to the new table, and 4. changing the length in the PSP to the new length. All that happened in DOS 3.3 is that Microsoft sanctioned this technique by adding a new DOS service that does the above 4 steps for you. (As I recall, though, at least some copies of DOS 3.3 do not implement this correctly, and will fail for certain table size requests). However, the default application file descriptor table size is still 20 (since the PSP hasn't changed) and the old technique of doing the 4 steps manually still works. >Your best bet would be to upgrade your version of DOS. Actually, I doubt that this will help very much. First, unless an application is written to check the version of DOS, and to USE the table-size function, you don't gain any benefit from upgrading to a new version of DOS. Since applications which use the "manual" technique work with ANY version of DOS, this is a much more attractive technique for the programmer to use. In any case, this doesn't help someone who is using a binary executable, not a program he has written himself. Even for the programmer who wants to use this technique, there are pitfalls. For instance, high level language libraries may assume that the fixed-length table is being used, and may not be able to handle the larger table. john nelson uucp: {decvax,mit-eddie}!genrad!jpn domain: jpn@genrad.com