Mail Archives: djgpp/2000/03/16/08:07:33
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).
- Raw text -