-
Notifications
You must be signed in to change notification settings - Fork 528
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
How to overwrite a file with less content #2203
Comments
A fix could be something like this:
|
This issue has been automatically marked as stale because it has not had recent activity for 90 days. It will be closed if no further activity occurs within 21 days. Thank you for your contributions. |
Don't closeas this needs fixin or proper instructions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems it updates the file in place leaving the old content in the tail.
zfile_output calls
fopen (self->fullname, "r+b");
which according to docs:r+ or rb+ or r+b: Open file for update (reading and writing).
To write the new file without a tail of old data we'd need:
w+ or wb+ or w+b
Truncate to zero length or create file for update.
However the old behaviour is probably also needed? Perhaps we need to add another method like
zfile_output_truncate
?The text was updated successfully, but these errors were encountered: