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 |
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 |
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 |
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 |
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) |
On 24 Jun 2013, at 19:59, Sven Van Caekenberghe <[hidden email]> wrote: > there has been anything else there had never been anything else |
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. > 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 |
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 |
Free forum by Nabble | Edit this page |