Smalltalk: Writing output to a file?

You want to use a FileStream See this link describing FileStreams Excerpt below: FileStream FileStreams support all of ExternalStreams protocol. They can be created to read, write, readWrite or append from/to a file. Creation: * for reading: aStream := FileStream readonlyFileNamed:aFilenameString * to read/write an existing file: aStream := FileStream oldFileNamed:aFilenameString * to create a new file for writing: aStream := FileStream newFileNamed:aFilenameString The above was the internal low level instance creation protocol, which is somewhat politically incorrect to use.

For portability, please use the companion class Filename to create fileStreams: * for reading: aStream := aFilenameString asFilename readStream * to read/write an existing file: aStream := aFilenameString asFilename readWriteStream * to create a new file for writing: aStream := aFilenameString asFilename writeStream * to append to an existing file: aStream := aFilenameString asFilename appendingWriteStream.

And then of course don't forget to handle the character encoding you want, if you're not writing binary or the default encoding. In Pharo/Squeak, set the converter to the needed TextConverter subclass.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions