Open
Description
ref := FileSystem disk workingDirectory / 'fstest.txt'.
ref writeStreamDo: [:stream |
stream nextPutAll: 'abcde'].
ref contents. "'abcde'"
ref writeStreamDo: [:stream |
stream nextPutAll: 'XYZ'].
ref contents "'XYZde'"
I would have expected just 'XYZ'
, analogously to FileStream class>>#forceNewFileNamed:
.
But, is this a bug or intended behavior?
This issue can be avoided by sending assureDeleted
to the reference prior to opening it for the second write. But this sounds less convenient than Squeak's built-in protocols ... And (to me) this was quite surprising and cost me a lot of time to debug. 😅
Metadata
Metadata
Assignees
Labels
No labels
Activity