On Apr 8, 2007, at 21:13 , Ian Oversby wrote:

Is this a reasonable way of writing to a file?  It seems to run a
little slower than I would expect.

Thanks,

Ian

| myFile |
myFile := StandardFileStream fileNamed: 'c:/test.txt'

Transcript show: (Time millisecondsToRun: [
   1 to: 10000 do: [
            :x | myFile nextPutAll: ((x asString) , String crlf)
        ]]) asString , ' millseconds' ; cr.

myFile close.

It is unbuffered. Write to an in-memory stream first and then put the whole thing into the file.

- Bert -


_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to