Path: utzoo!utgpu!jarvis.csri.toronto.edu!torsqnt!tmsoft!masnet!canremote!bradley.grigor From: bradley.grigor@canremote.uucp (BRADLEY GRIGOR) Newsgroups: comp.sys.ibm.pc Subject: Re: ms-dos FILES=fd in config Message-ID: <90030820225859@masnet.uucp> Date: 6 Mar 90 00:37:00 GMT Organization: Canada Remote Systems Limited, Mississauga, ON, Canada Lines: 54 dixon@sagittarius.crd.ge.com (walt dixon) writes Subj: ms-dos FILES=fd in config.sys parameter d.>Under DOS 3.3 there is an int 21h request to change the address of the d.>JFT. In previous DOS versions one could change the address and size d.>of the JFT in the PSP to increase the number of open files. In order d.>to have more than 20 open file handles, one must create a new JFT. [based on PC Tech Journal, Vol.6, No.4, April 1988, page 161] The DOS function mentioned by Walt Dixon is INT 21h, function 67h. In register BX, pass the required number of file handles. This function needs to allocate a block of memory to hold the expanded handle table, so the calling program must release some of its memory with function 4Ah prior to calling function 67h. The amount of memory used by function 67h is one byte per handle, rounded up to the next highest multiple of 16, plus 16 bytes for the memory control record. Due to a bug in the implementation of function 67h in IBM DOS 3.3, it is advisable to always request an ODD number of handles. However, one should be able to emulate function 67h as follows: 1. Use malloc or calloc to allocate a block of memory to hold a new handle table, one byte per handle. 2. Initialize this block to FFh, which indicates all files closed. 3. Copy the current 20-byte handle table from the PSP at offset 18h to the allocated block. 4. Store the length of the new handle table in the PSP at offset 32h, as a two-byte integer. 5. Store a far pointer (segment and offset) to the new handle table in the PSP at offset 34h. 6. Be sure the FILES=nn statement in CONFIG.SYS is large enough to accomodate required number of concurrently open files across the entire system. Disclaimer: This procedure is inferred from the PC Tech Journal article but I have not tried it myself. Note: despite the documentation, a child process created with the Exec function can only inherit twenty file handles from its parent. bradley.grigor@canremote.uucp : ALEX is coming to Toronto in April. Newmarket, Ontario, Canada : TelePoker will be there - will YOU? --- ~ DeLuxe 1.11 #4613 Boy, I wouldn't want to be in my shoes right now!