Seems didn't get sent...
Regards, Gary ----- Original Message -----
From: [hidden email]
To: [hidden email]
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 |
As a possible workaround, an offending package might load on a Mac or Linux system. Some time back, I encountered a package (an older version of RIO) that was broken on Windows, but I was able to install it on Linux, fix the Windows code there, and then it worked.
It's better to fix the real problem, but it can nice to be able to continue working. Bill ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Gary Chambers [[hidden email]] Sent: Monday, December 06, 2010 11:02 AM To: Pharo Development Subject: [Pharo-project] Bad characters in update package names Seems didn't get sent... Regards, Gary ----- Original Message ----- From: Gary Chambers<mailto:[hidden email]> To: Pharo Development<mailto:[hidden email]> 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 |
Currntly I'm doing the workaround by changing the package name in the
debugger ;-) Regards, Gary ----- Original Message ----- From: "Schwab,Wilhelm K" <[hidden email]> To: <[hidden email]> Sent: Monday, December 06, 2010 4:22 PM Subject: Re: [Pharo-project] Bad characters in update package names As a possible workaround, an offending package might load on a Mac or Linux system. Some time back, I encountered a package (an older version of RIO) that was broken on Windows, but I was able to install it on Linux, fix the Windows code there, and then it worked. It's better to fix the real problem, but it can nice to be able to continue working. Bill ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Gary Chambers [[hidden email]] Sent: Monday, December 06, 2010 11:02 AM To: Pharo Development Subject: [Pharo-project] Bad characters in update package names Seems didn't get sent... Regards, Gary ----- Original Message ----- From: Gary Chambers<mailto:[hidden email]> To: Pharo Development<mailto:[hidden email]> 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 |
In reply to this post by Gary Chambers-4
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 |
As Guillermo pointed out
'Issue 3191: SparseLargeArray-MarcusDenker.2.mcz' 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" <[hidden email]> To: <[hidden email]> 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 |
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" <[hidden email]> > To: <[hidden email]> > 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 > > > |
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" <[hidden email]> To: <[hidden email]> 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" > <[hidden email]> > To: <[hidden email]> > 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 > > > |
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" <[hidden email]> To: <[hidden email]> 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" <[hidden email]> > To: <[hidden email]> > 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" >> <[hidden email]> >> To: <[hidden email]> >> 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 >> >> >> > > > |
Gary,
Seeing that code reminds me of something in my backup system. My move to Linux was not complete without it, and Pharo plus OS Process does the job fairly well. One quirk involves spaces and ()[] in file names; there are probably others I have yet to find. For the cp command, I look for these characters and wrap the file name in double quotes to allow the copy to work. Perhaps there is room for this in each of the file directory classes, and for an option to detect problems and not fix them. In my case, the file needs to be copied; I just need to do what one would do from a terminal to get it to work, and that will arise elsewhere. Bill ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Gary Chambers [[hidden email]] Sent: Tuesday, December 07, 2010 11:40 AM To: [hidden email] Subject: Re: [Pharo-project] Bad characters in update package names 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 |
Free forum by Nabble | Edit this page |