After a bit of digging the following was found: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx Assuming we are not concerned with allowing ascii 0..31 in alternate data streams (an interesting concept I have used, though rather esoteric) then the following should do: 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]] Regards, Gary ----- Original Message ----- From: "Gary Chambers" <gazzaguru2@btinternet.com> To: <Pharo-project@lists.gforge.inria.fr> Sent: Tuesday, December 07, 2010 4:28 PM Subject: Re: [Pharo-project] Bad characters in update package names
After further investigation the $: does get converted to $# in DosFileDirectory>>checkName:fixErrors:
The real cause of grief is the tab character immediately following the colon.
The method modification below should help, though I expect the list of invalid charaters is not exhaustive yet and I'll see if I can find a complete set of them for Windows...
DosFileDirectory>> checkName: aFileName fixErrors: fixing "Check if the file name contains any invalid characters" | fName badChars hasBadChars | fName := super checkName: aFileName fixErrors: fixing. badChars := (#( $: $< $> $| $/ $\ $? $* $"), String tab, String lf, String cr) 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]]
Regards, Gary
----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Tuesday, December 07, 2010 11:55 AM Subject: Re: [Pharo-project] Bad characters in update package names
On Dec 7, 2010, at 12:46 PM, Gary Chambers wrote:
As Guillermo pointed out 'Issue 3191: SparseLargeArray-MarcusDenker.2.mcz'
this is the name of the package!!!! Argh jean-baptiste?
I will fix it now.
Stef
Amongst others... Windows will fail to create the local file in package-cache due to the colon in the name...
Regards, Gary
----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Tuesday, December 07, 2010 11:33 AM Subject: Re: [Pharo-project] Bad characters in update package names
Gary do you have the name of the package? And yes we should check that. I know that luc wrote some doc to make sure that package names would not contain stupid characters.
On Dec 6, 2010, at 5:02 PM, Gary Chambers wrote:
Seems didn't get sent...
Regards, Gary ----- Original Message ----- From: Gary Chambers To: Pharo Development Sent: Friday, December 03, 2010 4:02 PM Subject: Bad characters in update package names
It seems that having $: in the package name for certain updates is causing the save to local package cache to error on Windows (unsurprisingly).
Perhaps worth having a sanity check before the package name is accepted since it eventually gets to the filesystem.
Regards, Gary