On Fri, Jul 06, 2007 at 09:23:40AM +1000, johnps11@bigpond.com wrote:
Thanks Dave.
I'd looked at #close, but already had the system in a pretty weird state so it didn't seem to help.
#ensure: is the kind of thing I really needed - but never found.
It is a method on a block: BlockContext>>ensure: BlockClosure>>ensure:
you can use World Menu -> open -> Method Finder to find methods
Two more questions arise:
- How do I get a password to edit the wiki? The page 'Recipe: Reading a
file' could use a note about this.
username: squeak password: viewpoints
- 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 ]