Skip to content
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

JsonUtil.SerializeToFile doesn't truncate the target file first #1

Open
dpinela opened this issue May 13, 2024 · 0 comments
Open

JsonUtil.SerializeToFile doesn't truncate the target file first #1

dpinela opened this issue May 13, 2024 · 0 comments

Comments

@dpinela
Copy link

dpinela commented May 13, 2024

This is probably not the intended behavior? It's due to using File.OpenWrite here:

using StreamWriter sw = new(File.OpenWrite(filepath));

File.Create or File.CreateText would be more appropriate.

I noticed this when I overwrote a serialized RandoContext with this method, and had a chunk of the old version left at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant