` Printed Icetips Article

Icetips Article



ABC: Finding places where files are closed without calling the close method (C5)
1999-12-23 -- Scott Ferrett
 
Newsgroups: topspeed.products.c5ee

> There were lots of problems with "File Not
> Open" and there was no way we could find the missing closes.

I had an idea last night that will allow you to easily find these bugs
if you get future clients needing it tracked.

In abfile.clw add code add this just before the CLOSE call
SELF.File{PROP:Log} = 'In ABFILE'

Run the program with profiling on.  Once you get the file not open
error, close the file and search the log for CLOSE calls.  At least one
will not be preceded with In ABFILE.  That is the one being caused by
the thread terminating without fm.close being called.  You can then
look at the calls before to work out the bit of code that is missing
the call.

 SuRF



Printed November 23, 2024, 3:39 am
This article has been viewed/printed 35385 times.
Google search has resulted in one hit on this article since January 25, 2004.