At 09:09 AM 5/28/2007, [EMAIL PROTECTED] wrote:
>Is there a way to find out how many open files an application has?
>
>[snip]

Can't help you there except suggest you look at the SysInternals site to 
see if they have a utility for this.

>In fact I may call that subroutine a fairly huge number of times,
>opening different files during a session.
>Does that mean that I may end up with 100s of open files, or will they
>be closed down automatically, as I leave the subroutine?
>
>And/or as the files opened repeat, will I only end up with the number
>of different file names, or a number equivalent to the number of calls
>to the subroutine?

Open files are not closed automatically. I usually create a try..finally 
block and close the file in the finally section to ensure it gets closed. 
(The mere existence of the try..finally helps me remember that there was 
something important to handle at the end.)

Historically there was a maximum number of active file handles any Windows 
process could have but that may have been relaxed enough by now to be 
irrelevant. Just be sure to close the files.

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to