Issue 3386 in pharo: DosFileDirectory>> checkName: aFileName fixErrors: fixing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 3386 in pharo: DosFileDirectory>> checkName: aFileName fixErrors: fixing

pharo
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]]


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3386 in pharo: DosFileDirectory>> checkName: aFileName fixErrors: fixing

pharo
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.)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3386 in pharo: DosFileDirectory>> checkName: aFileName fixErrors: fixing

pharo
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