On Thu, Jul 05, 2007 at 04:47:15PM -0700, Matthew Fulmer wrote:
- When I had things really borked I did a 'Explore it' on 'FileStream
allInstances' and saw a few entries that had all the fields set to nil except fileID, which was the same value as a valid stream on the file. In Windows or unix I can close a file if all I have is the file descriptor(/handle). How would I close the file if I've broken all the references, apart from forcing a garbage collect?
FileStream allInstances do: [ :each | each close ]
you could also be selective about it:
- Type "FileStream allInstances" - hit cmd-shift-I (this runs the "explore it" command) - select the file you want to close - type "self close" in the code panel of the explorer - hit cmd-D ("do it")
but doing "Smalltalk garbageCollect" is fine too