Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!snorkelwacker!ira.uka.de!smurf!gopnbg!mcshh!akes From: akes@mcshh.hanse.de (Andreas Kessemeier) Newsgroups: comp.os.msdos.misc Subject: Re: Max files open Message-ID: <8159@mcshh.hanse.de> Date: 5 Oct 90 16:28:34 GMT References: <6548@castle.ed.ac.uk> Lines: 50 elev66@castle.ed.ac.uk (G Gaston) writes: >[Question about more then 20 Files in one Process under MSDOS] The Value of FILE= is not the only Value, which restricts the max. Number of open Files. There is a 'per Prozess' Table of open Files in the PSP (Programm Specifikation Block) of an executing Programm. This Table is initialized to 20 Entrys on Startup. There is not Way to tell MSDOS, to setup a larger Table, but you can do this on Startup in your Programm. - At Offset 28 in the PSP there is a Table of 20 Bytes. Each Byte has the Value 255, if the File is not open. - At Offset 56 in the PSP there is a Word containing the maximum Number of open Files. In the normal case the Value of this Word is 20 (see above). - At Offset 58 in the PSP there is a Doubleword - Pointer to the Table of open Files. This Pointer points initially to the above mentioned Table. To expand the Table of open Files, do the following: - Allocate a new Table, large enough to hold the Number of Entrys you want. - Copy the old Table (all 20 Entrys) into the new Table and initialize the remaining Entrys to 255. - Redirect the Pointer at Offset 58 to your new Table an update the Word at Offset 56 to the Size of yout new Table. Please Note: I have never tested this extensively, but it's same Way some Network - Shells are setting Things up. I have never heard of Problems with that. OOPS, before i forget: All Numbers are in Dezimal. Greets, Andreas --> Andreas Kessemeier Smart : akes@mcshh.hanse.de Bang : Need no steenking Bangs! Spruch : Wenn alles laeuft, dann haben wir irgendwas vergessen (Murphy)