Date: Thu, 16 Mar 2000 12:02:19 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jeffrey_Krupp AT May-Co DOT com cc: djgpp AT delorie DOT com Subject: Re: file handle problems In-Reply-To: <862568A3.007033B0.00@MAYCO.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 15 Mar 2000 Jeffrey_Krupp AT May-Co DOT com wrote: > I am having trouble opening files at some point in my > program. Throughout the whole program, I am opening, accessing, then > immediately closing the files using > fopen(),fputs/fgets,fclose(),ect. Eventually, I am unable to open > files. All of the return codes are good and I am not coming anywhere > near the 100 files I set in config.sys. Obviously, your program is leaking handles. Or some of the library functions you are using could leak handles. > I am running Caldera's DR. DOS 7.0 on an IBM 386 sx. Do you have any > suggestions? What version of DJGPP do you have? If it's not the latest v2.03, the first suggestion would be to upgrade. Several bugfixes in v2.03 were to plumb a few of such leaks. If that doesn't help, I'd suggest to instrument your program so that you could watch files being open and closed, and find the offending code. One way to do that would be to use the Filesystem Extension feature to install a handler for open and close functions, and make the handler simply report the handles and files to some log file. Another possibility is to run the program under a debugger with breakpoints in _open and _close (assuming you don't use int86 or __dpmi_int to open/close files).