Path: utzoo!utgpu!watserv1!watmath!att!bellcore!rutgers!usc!snorkelwacker!ira.uka.de!smurf!urlichs From: urlichs@smurf.sub.org (Matthias Urlichs) Newsgroups: comp.sys.mac.programmer Subject: Re: 10 open file limit - thanks but still puzzled Message-ID: Date: 16 Jun 90 08:56:39 GMT References: <1990Jun15.002653.1897@vaxa.uwa.oz> Organization: University of Karlsruhe, FRG Lines: 34 In comp.sys.mac.programmer, article <1990Jun15.002653.1897@vaxa.uwa.oz>, a_dent@vaxa.uwa.oz.au writes: < [...] I don't quite understand < how this limit can be expanded dynamically (one suggestion was to write an < XCMD to do so). Quoting page 178 of IM vol 4 "The file-control-block-buffer < is a nonrelocatable block in the system heap, the first word contains the < length of the buffer.". [...] There's a low memory global which points to this block, and another which says how big one FCB is. So what you do is to lock out interrupts, create a new pointer with the appropriate new size in the System heap, copy all the stuff over, and set the low-mem pointre to point to your block. NB: You can't increase the size of the FCB table beyond 64k because currently, file refnums are just offsets into that table (and they're integers). If you increase it beyond 32k, you're bound to run into some buggy applications which treat file refnums as signed and consider "negative" refnums as error codes. (I didn't test real applications for this, but I've seen sample code which does make that assumption.) < BTW, from where did you guys get your multipliers as applied to the < "number of open files" field in the boot blocks? I checked Technotes and < IM and the couldn't spot it! < It should be somewhere in the boot code, either ROM or in the System file. You might want to compare the boot block number to the actual number of FCBs to determine the factor -- if it's not a whole number, chances are that someone either increased the FCB count or the number in the boot block before you. -- Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(Voice)/621227(PEP)