Xref: utzoo comp.sys.mac.programmer:15280 comp.sys.mac.system:501 Path: utzoo!attcan!uunet!snorkelwacker!ira.uka.de!smurf!urlichs From: urlichs@smurf.sub.org (Matthias Urlichs) Newsgroups: comp.sys.mac.programmer,comp.sys.mac.system Subject: Re: Changing the 10 open files limit - good idea? Message-ID: <[lq&d2.5%6@smurf.sub.org> Date: 11 Jun 90 19:36:05 GMT References: <1990Jun11.195357.1886@vaxa.uwa.oz> Organization: University of Karlsruhe, FRG Lines: 44 In comp.sys.mac.programmer, article <1990Jun11.195357.1886@vaxa.uwa.oz>, a_dent@vaxa.uwa.oz writes: < I've been working in FoxBASE+/Mac and one of my databases is really complicated, < the easy way out has been to leave 9 datafiles and 19 indexes permanently open. < < The only trouble with this is the limit on open files - the standard boot < block setting is TEN files (apparently regardless of machine size - CPU, RAM, < diskspace - you name it). < < My choices are: < 1) A lot of painful coding to try to keep within the limit of 10 files. < 2) Write a utility to set the limit (no problems technically). 3) Use System 7 which makes this number dynamic. ;-) 4) Write a small utility which looks at the number of FCBs and increases it if necessary. Package it as an XCMD and call it from FoxBase. 5) Install an INIT like "Up your FCBs" (I don't know who wrote that one) to increase that number, or do it yourself. The ten files limit is actually multiplied by something like 2 or 4, depending on how much memory you have. When increasing the number of FCBs, remember to (a) turn off interrupts, (b) treat the appropriate low-memory globals correctly, (c) don't dispose of the old FCB list because you don't know where it might have come from. (Is this guaranteed to be a pointer from the System heap? Apple?) Aside: System 7 dynamically increases the number of FCBs if necessary. The preliminary documentation says that in order to do so, calling _Open (with a file) from interrupt level is now forbidden. This strikes me as a bad idea; it'd be better to return an error if necessary. Something like that already happens if an async operation needs an offline disk; an error is returned instead of popping up the dialog (which can't happen from an interrupt). < < By the way, the limit seems to apply across the entire Mac system, not just to < one program, under Multifinder. This seems a ridiculous restriction - a 5Mb < Mac with two applications running could easily get close to 10 files just < by handling a couple of documents per application. < As I remember, that mac would have 20 or possibly 40 FCBs. Still not enough in some cases. -- Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(Voice)/621227(PEP)