'From Squeak3.6alpha of ''17 March 2003'' [latest update: #5240] on 7 June 2003 at 2:59:38 pm'! "Change Set: AcornFileDirectoryfix Date: 7 June 2003 Author: tim@sumeru.stanford.edu Stop RiscOS-illegal chars in filename"! !AcornFileDirectory methodsFor: 'file name utilities' stamp: 'tpr 6/7/2003 09:56'! checkName: aFileName fixErrors: fixing "Check if the file name contains any invalid characters" | fName badChars hasBadChars | fName _ super checkName: aFileName fixErrors: fixing. badChars _ #( $# $: $< $> $| $? $* $") asSet. hasBadChars _ fName includesAnyOf: badChars. (hasBadChars and:[fixing not]) ifTrue:[^self error:'Invalid file name']. hasBadChars ifFalse:[^ fName]. ^ fName collect: [:char | (badChars includes: char) ifTrue:[$!!] ifFalse:[char]]! !