[Pharo-project] Issue 3386 in pharo: DosFileDirectory>> checkName: aFileName fixErrors: fixing
Status: Accepted Owner: stephane.ducasse Labels: Milestone-1.2 New issue 3386 by stephane.ducasse: DosFileDirectory>> checkName: aFileName fixErrors: fixing http://code.google.com/p/pharo/issues/detail?id=3386 DosFileDirectory>> checkName: aFileName fixErrors: fixing "Check if the file name contains any invalid characters" | fName badChars hasBadChars | fName := super checkName: aFileName fixErrors: fixing. badChars := (#( $: $< $> $| $/ $\ $? $* $"), ((0 to: 31) collect: [:n | n asCharacter])) 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]]
Updates: Status: Fixed Comment #1 on issue 3386 by siguctua: DosFileDirectory>> checkName: aFileName fixErrors: fixing http://code.google.com/p/pharo/issues/detail?id=3386 (No comment was entered for this change.)
Updates: Status: Closed Comment #2 on issue 3386 by stephane.ducasse: DosFileDirectory>> checkName: aFileName fixErrors: fixing http://code.google.com/p/pharo/issues/detail?id=3386 in 12275
participants (1)
-
pharo@googlecode.com