newFileNamed (how to handle the cancel option?)

chenais patrick.chenais at id.unibe.ch
Mon Jan 17 13:34:02 UTC 2005


Hello Ned!
Thank you for your response. I tried as you said:

[ f := FileStream newFileNamed: aFilename ]
	on: FileExistsException
	do: [ :ex | Transcript show: ex fileName; cr. ex return: nil ].

I don't get any error anymore but...
Actually all FileExistsExecption are catched, hence if the aFilename already
exists the menu - (1) overwrite, (2) choose another, (3) cancel - does not
come anymore. I cannot overwrite an existing file.

I could manage in my software the cases: File exist and File doesn’t exist,
but is there not a simple way to define the behaviour of the (3) cancel
option?

Thanks again.
Patrick Chénais






More information about the Squeak-dev mailing list