where is appendStream?

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

where is appendStream?

hayatou

Hello,
I use in Pharo 2.0  the class FileSystem to write in a text file(csv format).  I find only two options writeStream and readStream.  I would not like each time to overwrite the contents of my file and I do not find the option appendStream. How can I do?


working := FileSystem disk workingDirectory.
stream := (working / 'test.csv') writeStream
stream nextPutAll: 'something'.
stream nextPutAll: ';' .
stream nextPutAll: 'other'.
stream close.
------------------------------------
Hayatou  
Reply | Threaded
Open this post in threaded view
|

where is appendStream?

hayatou

Hello,
I use in Pharo 2.0  the class FileSystem to write in a text file(csv format).  I find only two options writeStream and readStream.  I would not like each time to overwrite the contents of my file and I do not find the option appendStream. How can I do?


working := FileSystem disk workingDirectory.
stream := (working / 'test.csv') writeStream
stream nextPutAll: 'something'.
stream nextPutAll: ';' .
stream nextPutAll: 'other'.
stream close.
------------------------------------
Hayatou  


Reply | Threaded
Open this post in threaded view
|

Re: where is appendStream?

Sven Van Caekenberghe-2
Hayatou,

Open a WriteStream and call #setToEnd before writing.

Sven

On 24 Jun 2013, at 14:27, Hayatou Oumarou <[hidden email]> wrote:

> Hello,
> I use in Pharo 2.0  the class FileSystem to write in a text file(csv format).  I find only two options writeStream and readStream.  I would not like each time to overwrite the contents of my file and I do not find the option appendStream. How can I do?
>
>
> working := FileSystem disk workingDirectory.
> stream := (working / 'test.csv') writeStream
> stream nextPutAll: 'something'.
> stream nextPutAll: ';' .
> stream nextPutAll: 'other'.
> stream close.
> ------------------------------------
> Hayatou  

--
Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org





Reply | Threaded
Open this post in threaded view
|

Re: where is appendStream?

bahman
On Mon, 2013-06-24 at 14:43 +0200, Sven Van Caekenberghe wrote:
> Hayatou,
>
> Open a WriteStream and call #setToEnd before writing.
>
> Sven

I'm sure these changes in the API are documented somewhere extensively,
however I cannot find it.  Do you have any pointers/links?

TIA,


> On 24 Jun 2013, at 14:27, Hayatou Oumarou <[hidden email]> wrote:
>
> > Hello,
> > I use in Pharo 2.0  the class FileSystem to write in a text file(csv format).  I find only two options writeStream and readStream.  I would not like each time to overwrite the contents of my file and I do not find the option appendStream. How can I do?
> >
> >
> > working := FileSystem disk workingDirectory.
> > stream := (working / 'test.csv') writeStream
> > stream nextPutAll: 'something'.
> > stream nextPutAll: ';' .
> > stream nextPutAll: 'other'.
> > stream close.
--
Bahman Movaqar  (http://BahmanM.com)

ERP Evaluation, Implementation & Deployment Consultant
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)

signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: where is appendStream?

Sven Van Caekenberghe-2

On 24 Jun 2013, at 19:42, Bahman Movaqar <[hidden email]> wrote:

> On Mon, 2013-06-24 at 14:43 +0200, Sven Van Caekenberghe wrote:
>> Hayatou,
>>
>> Open a WriteStream and call #setToEnd before writing.
>>
>> Sven
>
> I'm sure these changes in the API are documented somewhere extensively,
> however I cannot find it.  Do you have any pointers/links?

I don't understand the question. AFAIK, there has been anything else. This is the way it is. I find it quite logical.

Not that the Stream hierarchy makes perfect sense in all cases, but that is another story ;-)

> TIA,
>
>> On 24 Jun 2013, at 14:27, Hayatou Oumarou <[hidden email]> wrote:
>>
>>> Hello,
>>> I use in Pharo 2.0  the class FileSystem to write in a text file(csv format).  I find only two options writeStream and readStream.  I would not like each time to overwrite the contents of my file and I do not find the option appendStream. How can I do?
>>>
>>>
>>> working := FileSystem disk workingDirectory.
>>> stream := (working / 'test.csv') writeStream
>>> stream nextPutAll: 'something'.
>>> stream nextPutAll: ';' .
>>> stream nextPutAll: 'other'.
>>> stream close.
>
> --
> Bahman Movaqar  (http://BahmanM.com)
>
> ERP Evaluation, Implementation & Deployment Consultant
> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)


Reply | Threaded
Open this post in threaded view
|

Re: where is appendStream?

Sven Van Caekenberghe

On 24 Jun 2013, at 19:59, Sven Van Caekenberghe <[hidden email]> wrote:

> there has been anything else

there had never been anything else

Reply | Threaded
Open this post in threaded view
|

Re: where is appendStream?

bahman
In reply to this post by Sven Van Caekenberghe-2
On Mon, 2013-06-24 at 19:59 +0200, Sven Van Caekenberghe wrote:

> On 24 Jun 2013, at 19:42, Bahman Movaqar <[hidden email]> wrote:
>
> > On Mon, 2013-06-24 at 14:43 +0200, Sven Van Caekenberghe wrote:
> >> Hayatou,
> >>
> >> Open a WriteStream and call #setToEnd before writing.
> >>
> >
> > I'm sure these changes in the API are documented somewhere extensively,
> > however I cannot find it.  Do you have any pointers/links?
>
> I don't understand the question. AFAIK, there has been anything else. This is the way it is. I find it quite logical.
Thank you.

> Not that the Stream hierarchy makes perfect sense in all cases, but that is another story ;-)
>
> > TIA,
> >
> >> On 24 Jun 2013, at 14:27, Hayatou Oumarou <[hidden email]> wrote:
> >>
> >>> Hello,
> >>> I use in Pharo 2.0  the class FileSystem to write in a text file(csv format).  I find only two options writeStream and readStream.  I would not like each time to overwrite the contents of my file and I do not find the option appendStream. How can I do?
> >>>
> >>>
> >>> working := FileSystem disk workingDirectory.
> >>> stream := (working / 'test.csv') writeStream
> >>> stream nextPutAll: 'something'.
> >>> stream nextPutAll: ';' .
> >>> stream nextPutAll: 'other'.
> >>> stream close.
--
Bahman Movaqar  (http://BahmanM.com)

ERP Evaluation, Implementation & Deployment Consultant
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)

signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: where is appendStream?

Camillo Bruni-3
In reply to this post by hayatou
you can use
       
        fileReference writeStream setToEnd

instead of just writeStream, that should be the same behavior as appendStream...

On 2013-06-24, at 14:20, Hayatou Oumarou <[hidden email]> wrote:

> Hello,
> I use in Pharo 2.0  the class FileSystem to write in a text file(csv format).  I find only two options writeStream and readStream.  I would not like each time to overwrite the contents of my file and I do not find the option appendStream. How can I do?
>
>
>
> working := FileSystem disk workingDirectory.
> stream := (working / 'test.csv') writeStream
> stream nextPutAll: 'something'.
> stream nextPutAll: ';' .
> stream nextPutAll: 'other'.
> stream close.
>
> ------------------------------------
> Hayatou