Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!ncar!ico!nbires!maa From: maa@nbires.nbi.com (Mark Armbrust) Newsgroups: comp.sys.ibm.pc Subject: Re: Opening up to 255 files in DOS 3.30 Summary: "SET HANDLE COUNT" function Message-ID: <417@nbires.nbi.com> Date: 28 Jun 89 20:13:27 GMT References: <2385@ur-cc.UUCP> Reply-To: maa@nbires.UUCP (Mark Armbrust) Organization: NBI Inc, Boulder CO Lines: 60 In article <2385@ur-cc.UUCP> chu2_ltd@uhura.cc.rochester.edu (Jim Huang) writes: > > I would like to know how to open a large number of files at > once under MS-DOS 3.30. For instance, if I want to open > 50 files, I would put the line: > > files = 50 > > in my CONFIG.SYS file and reboot. However, this does not > seem to work. There is normally a 20 file per process limit in MS-DOS. Starting with 3.30, there is a new DOS call to increase this number. This is from the 3.30 programmer's reference that came in our OEM kit: =============================================== Set Handle Count (Function 67H) Call: AH = 67H BX Number of allowed handles Return: Carry set: AX [error occured; return values not documented. Probably the same as Allocate memory call. --maa] Carry not set: No error Comments: Function 67H increases or decreases the number of files a program can have open at one time. The maximum number of files handles is 64K. If less than 20 are specified, the minimum handle number, 20, is assumed. If this call is used to reduce the number of allowed handles, the new limit does not take affect until any handles above the new limit are closed. The user should use Call 4AH (Set Block) to allocate memory for the extended handle list if BX is greater than 255. The maximum number for the value of the config.sys command files is 255. =============================================== You should be able to issue this call from C using the "intdos()" function, but I don't know it the C runtime library can handle more than 20 open high- level (buffered) files. It should not care about the number of open low-level files since this appears to be an MS-DOS handle based I/O system. All of this paragraph is just my best guess. -- Mark Armbrust maa@nbires.nbi.com maa@nbires.UUCP