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

File size update in write doesn't respect seek position #72

Closed
CBJamo opened this issue Jan 24, 2023 · 2 comments
Closed

File size update in write doesn't respect seek position #72

CBJamo opened this issue Jan 24, 2023 · 2 comments

Comments

@CBJamo
Copy link

CBJamo commented Jan 24, 2023

At controller#L577 the file size is increased unconditionally. This means that if you've seek-ed back into the file you'll bloat the end of the file with 0s.

@eldruin
Copy link
Member

eldruin commented Jan 27, 2023

Any ideas on this @thejpster?

@thejpster
Copy link
Member

They're right, sounds like a bug. You need to calculate how much you've extended the file by.

let new_size = current_pos + amount_written;
if new_size > current_size {
    store(new_size)
}

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

3 participants