-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#writeStream
does not clear old file contents, should it?
#12
Comments
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, |
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: