Skip to content

Truncate existing temp file in meta_partition constructor#93

Merged
jermp merged 1 commit intojermp:masterfrom
adamant-pwn:patch-2
Oct 6, 2025
Merged

Truncate existing temp file in meta_partition constructor#93
jermp merged 1 commit intojermp:masterfrom
adamant-pwn:patch-2

Conversation

@adamant-pwn
Copy link
Copy Markdown
Contributor

Ensure the temp file is truncated if it exists. Otherwise, repeated independent runs would add lines to the same file, and it isn't detected when the files are read later on, leading to "seed didn't work" exceptions.

Ensure the temp file is truncated if it exists.
@adamant-pwn
Copy link
Copy Markdown
Contributor Author

adamant-pwn commented Oct 5, 2025

Might make sense to also add a cleanup to whatever place in the code where it's no longer needed?

UPD: On further inspection, I see that you do clean up with std::remove. Nevertheless, I ran into some issues locally when the files somehow still existed (perhaps due to unexpected termination in previous runs), and in such cases if it runs into failure again (typically the "seed did not work" situation), it won't clean them up again due to consequent early terminations, so making sure they're empty in the constructor would still make sense.

@jermp
Copy link
Copy Markdown
Owner

jermp commented Oct 6, 2025

Ok, makes sense, thanks :)

@jermp jermp merged commit 231b62b into jermp:master Oct 6, 2025
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants