You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. 😅
The text was updated successfully, but these errors were encountered:
LinqLover
added a commit
to LinqLover/SqueakByExample-english
that referenced
this issue
Nov 21, 2023
You can also send #truncate at the right moment. Hard to say whether it should do that on its own or not without a specificaton... Can you please compare what Pharo's implementation does? So far I usually looked there to find out what was intended. It has the additional benefit that it stays at least a bit consistent across dialects...
Pharo seems to work the same way. Funnily, both in Squeak and Pharo, MemoryFileSystem always replaces the contents indeed, so it is basically undefined behavior ... Anyway, truncate is a good pointer, thank you. Wondering which is more efficient and idiomatic (also in terms of preserving file permissions/attributes etc.), truncate or ensureDeleted ...
I would have expected just
'XYZ'
, analogously toFileStream 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. 😅The text was updated successfully, but these errors were encountered: