On Tue, Aug 10, 2010 at 11:32 AM, St�phane Ducasse
<stephane.ducasse@inria.fr> wrote:
Yes I integrated a "fix" of eliot so that you can fileout category containing / but this is not a so great idea. :)
It's not such a bad idea. �Try filing-out a category that contains / (e.g. fileIn/out :) ) without it. �But you need to fix other places as well. �Andreas fixed this yesterday in trunk by not passing the full path to�checkName:fixErrors:. �This isn't necessary. �One only needs the local name since "FileStream newFileNamed: fileName" will construct a file in the current directory.
http://code.google.com/p/pharo/issues/detail?id=2661
writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag useHtml: useHtml
� � � | extension converter f fileName |
� � � aStream contents isAsciiString ifTrue: [
� � � � � � � stOrCsFlag ifTrue: [
� � � � � � � � � � � extension := (FileDirectory dot, FileStream st).
� � � � � � � ] ifFalse: [
� � � � � � � � � � � extension := (FileDirectory dot, FileStream cs).
� � � � � � � ].
� � � � � � � converter := MacRomanTextConverter new.
� � � ] ifFalse: [
� � � � � � � stOrCsFlag ifTrue: [
� � � � � � � � � � � extension := (FileDirectory dot, FileStream st "multiSt").
� � � � � � � ] ifFalse: [
� � � � � � � � � � � extension := (FileDirectory dot, FileStream cs "multiCs").
� � � � � � � ].
� � � � � � � converter := UTF8TextConverter new.
� � � ].
� � � fileName := useHtml ifTrue: [baseName, '.html'] ifFalse: [baseName, extension].
+ � � � fileName := FileDirectory default checkName: fileName fixErrors: true.
� � � f := FileStream newFileNamed: fileName.
� � � f ifNil: [^ self error: 'Cannot open file'].
� � � (converter isMemberOf: UTF8TextConverter)
� � � � � � � ifTrue: [f binary.
� � � � � � � � � � � UTF8TextConverter writeBOMOn: f].
� � � f text.
� � � f converter: converter.
� � � f nextPutAll: aStream contents.
� � � f close.
�!
checkName: aFileName fixErrors: fixing
+ � � � "Check if the file name contains any invalid characters"
+ � � � | fName |
+ � � � fName := super checkName: aFileName fixErrors: fixing.
+ � � � (fName includes: self class pathNameDelimiter) ifFalse:
+ � � � � � � � [^fName].
+ � � � ^fixing
+ � � � � � � � ifTrue: [fName copyReplaceAll: (String with: self class pathNameDelimiter) with: '#']
+ � � � � � � � ifFalse: [self error:'Invalid file name']
Stef
On Aug 10, 2010, at 4:23 PM, Gary Chambers wrote:
> Has anyone else noticed that, very recently, when filing out change sets from the change sorter the filename is rather odd
> (at least on Windows)?
>
>
> Instead of the expected "OngoingFixes.2.cs" I'm getting
> "C##Users#Gazza#Desktop#Pharo#Contents#Resources#OngoingFixes.2.cs"
>
> saved where expected (in Contents\Resources).
>
> Regards, Gary
> _______________________________________________
> Pharo-project mailing list
> Pharo-project@lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project