Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!im4u!jai From: jai@im4u.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Limits on MSDOS file handles (was: File handles, ProComm and MS C) Message-ID: <1511@im4u.UUCP> Date: Thu, 19-Feb-87 16:53:01 EST Article-I.D.: im4u.1511 Posted: Thu Feb 19 16:53:01 1987 Date-Received: Fri, 20-Feb-87 21:09:12 EST Reply-To: jai@im4u.UUCP (Jai Srinivasan) Distribution: world Organization: U. Texas CS Dept., Austin, Texas Lines: 44 In article <421@omepd>, perry@inteloa.intel.com (Perry The Cynic) writes: >In article <1500@im4u.UUCP> jai@im4u.UUCP (Jai Srinivasan) writes: >>I have a C program run from a Procomm command file. The program >>runs fine when called directly from DOS. When called by Procomm >>from the command file, it exits saying that it cannot open a file. >>Naturally, I suspected that Procomm left several files open before >>executing the program; so I closed stdprn and stdaux at the start >>of the program and tried it again. And got the same results. >>Finally, I increased the number of FILES in CONFIG.SYS; the program >>is executed properly now when called from Procomm. > > >Closing inherited handles (standard or otherwise) is freeing them up both >towards the program limit (20) and the total limit (FILES). In your case, >though, closing only two handles just wasn't enough. Consider that if PROCOMM >has 5 non-preset handles opened, it is already occupying 10 handles (5 standard >plus 5 more)! Another two (or more) go to the COMMAND.COM that started your >PROCOMM, and there isn't that much left. > That still does not explain the anamoly. I should have mentioned that the program, when run from ProComm, always succeeded in opening one file and then failed to open the next one. If the above is correct (closing a file frees the handle for both the program and the system limit), the program should have run with stdaux and stdprn closed as 2 files were being closed in an attempt to open one. But closing stdprn and stdaux made no difference: it yet opened one and failed to open the next. The conclusion would appear to be that closing standard files (or at least stdprn and stdaux) does not free handles for the system limit. Anyone care to comment? Some additional info may help: The number of FILES in CONFIG.SYS was 20 and then was increased to 25 to get the program running from ProComm. ----------------- Jai Srinivasan, UUCP: {gatech,harvard,ihnp4,pyramid,seismo}!ut-sally!im4u!jai ARPA: jai@im4u.UTEXAS.EDU, jai@sally.UTEXAS.EDU