[Pharo-dev] Is fileout on the change sorter working in Pharo 70?

Stephane Ducasse stepharo.self at gmail.com
Thu Nov 9 16:05:14 EST 2017


Tx guille.
We should probably improve the class comment of File to express that this
is the low level layer.

Stef

On Thu, Nov 9, 2017 at 10:50 AM, Guillermo Polito <guillermopolito at gmail.com
> wrote:

>
>
> On Thu, Nov 9, 2017 at 10:35 AM, Denis Kudriashov <dionisiydk at gmail.com>
> wrote:
>
>> Hi
>>
>> 2017-11-08 21:53 GMT+01:00 Stephane Ducasse <stepharo.self at gmail.com>:
>>
>>> It looks like the problem is here but I cannot find it.
>>>
>>> CodeExporter>> writeSourceCodeFrom: aStream baseName: baseName isSt:
>>> stOrCsFlag
>>>
>>> | extension fileName  outputStream |
>>> self halt.
>>> extension := stOrCsFlag ifTrue: ['.st']  ifFalse: ['.cs'].
>>> fileName := baseName, extension.
>>> fileName := FileSystem disk checkName: fileName fixErrors: true.
>>> outputStream := (File named: fileName) writeStream.
>>> (ZnCrPortableWriteStream on: (ZnCharacterWriteStream
>>> on: outputStream
>>> encoding: 'utf8')) nextPutAll: aStream contents.
>>>
>>> outputStream close.
>>>
>>> self inform: 'Filed out to: ', String cr, fileName.
>>
>>
>> Try rewrite code to FileSystem. I think we should never use File directly:
>>
>> extension := stOrCsFlag ifTrue: ['st']  ifFalse: ['cs'].
>> FileLocator home / baseName , extension writeStreamDo: [:s |
>>
>> (ZnCrPortableWriteStream on: (ZnCharacterWriteStream
>>
>> on: s
>>
>> encoding: 'utf8')) nextPutAll: aStream contents].
>>
>> We should choose what to use instead of #home in that case.
>>
>
> I just discussed a point with Denis, just replicating it here.
>
> We should not **blindly** rewrite everything to use FileSystem. Because
> that may break dependencies in the system.
> For example, CodeExporter is used by Monticello.
>
> Should monticello depend on FileSystem or not?
>
> I'm not saying monticello should or should not depend on it. Just saying
> that we should ask ourselves the question :)
>
>
>>
>> I wondering does File is actually used by FileSystem?
>>
>
> It will ;)
>
>
>> Should not we remove it from system?
>>
>
> No! File is exactly the low level File representation, that FileSystem
> should use.
>
>
>>
>>
>>>
>>> On Wed, Nov 8, 2017 at 9:38 PM, Stephane Ducasse
>>> <stepharo.self at gmail.com> wrote:
>>> > Ah thanks we should fix this.
>>> >
>>> > On Wed, Nov 8, 2017 at 9:31 PM, Christian Kellermann
>>> > <ckeen at pestilenz.org> wrote:
>>> >> * Stephane Ducasse <stepharo.self at gmail.com> [171108 21:29]:
>>> >>> Hi
>>> >>>
>>> >>> I'm trying to rescue some of my work (that I cannot save in MC nor in
>>> >>> Iceberg because the system
>>> >>> does not see it - super funny).
>>> >>>
>>> >>> I can browse the change using the changesorter when I do fileout
>>> >>> the system tells me that the file it saved but I cannot find it on
>>> my disc.
>>> >>> Apparently none of the fileout is working in the changesorter. :(
>>> >>
>>> >> I have successfully filed out code with epicea but not changesorter.
>>> >>
>>> >> HTH,
>>> >>
>>> >> Christian
>>> >>
>>> >> --
>>> >> May you be peaceful, may you live in safety, may you be free from
>>> >> suffering, and may you live with ease.
>>> >>
>>>
>>>
>>
>
>
> --
>
>
>
> Guille Polito
>
> Research Engineer
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
>
> CRIStAL - UMR 9189
>
> French National Center for Scientific Research - *http://www.cnrs.fr
> <http://www.cnrs.fr>*
>
>
> *Web:* *http://guillep.github.io* <http://guillep.github.io>
>
> *Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20171109/e15fcc60/attachment-0002.html>


More information about the Pharo-dev mailing list