[Q] How do I close file handles within Squeak?

Ned Konz ned at bike-nomad.com
Tue Feb 18 19:37:27 UTC 2003

On Tuesday 18 February 2003 11:23 am, Brent Vukmer wrote:
> I'm running on Win2k.  I see ( via the invaluable "procexp" tool )
> that Squeak.exe has a handle on the "Cryptography.cs" file.  Is
> there a way within Squeak to discover what files it has open, and
> then to close orphan file handles?

There should be no "orphan" file handles. OS level file handles are 
closed upon a GC, or sooner if a file is explicitly closed.

You can do something like: 

Smalltalk garbageCollect.
(FileStream allSubInstances select: [ :ea | ea closed not ]) inspect.

Ned Konz

More information about the Squeak-dev mailing list