[squeak-dev] CustomHelpToOrg dev question.

Chris Muller asqueaker at gmail.com
Fri Sep 3 20:33:55 UTC 2021


Hi Levente,

An easy way to avoid that would be to write directly into the file stream,
> but Squeak's file streams are not write-buffered
>

Hm, I always thought they were.  A quick script I used to verify:

| ws rs |
nil assert: (FileDirectory default fileExists: 'writebuffered') not.
FileDirectory default deleteFileNamed: 'writebuffered'.
[ws := FileStream fileNamed: 'writebuffered'.
rs := FileStream readOnlyFileNamed: 'writebuffered'.
ws nextPutAll: '12345678901'.
"Assert only buffered, not written"
   nil assert: (rs next: 10) isEmpty.
"Force physical write"
   ws flush.
"Assert written"
   nil assert: (rs next: 10) = '1234567890' ] ensure:
[ ws ifNotNil: [ws close].
rs ifNotNil: [rs close] ]

 - Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210903/f1439356/attachment.html>


More information about the Squeak-dev mailing list