newFileNamed (how to handle the cancel option?)

chenais patrick.chenais at id.unibe.ch
Thu Jan 13 13:05:09 UTC 2005


Hello!!
I have a small question. I save data into files using following:
f := FileStream newFileNamed: aFilename.
f ifNotNil: [
	f nextPutAll: (myobject sixxString).
		f close ]

If 'aFilename' already exits, I get from newFileNamed a menu: 
- overwrite...
- choose another name...
- cancel

cancel generates an error. 
My question is how can I get rid of this error?

Thank you for your help.
Patrick Chénais

University of Bern
Informatikdienste





More information about the Squeak-dev mailing list