[squeak-dev] CustomHelpToOrg dev question.
asqueaker at gmail.com
Fri Sep 3 20:33:55 UTC 2021
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"
nil assert: (rs next: 10) = '1234567890' ] ensure:
[ ws ifNotNil: [ws close].
rs ifNotNil: [rs close] ]
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev