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

Removing async code from file writes #94

Merged
merged 6 commits into from
Aug 14, 2024
Merged

Conversation

MichaelGHSeg
Copy link
Contributor

@MichaelGHSeg MichaelGHSeg commented Aug 9, 2024

Changing corrupt file removal to not fail init, and removing async code from file write that may be making file corruption more likely.

bsneed
bsneed previously approved these changes Aug 13, 2024
@bsneed
Copy link

bsneed commented Aug 13, 2024

Can you put some comments in there about why you're doing xyz in various places and maybe reference back to a bug? Nice work!

file.lockSync(FileLock.blockingExclusive);
file.setPositionSync(0);
file.writeFromSync(buffer);
file.truncateSync(buffer.length);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about security out-loud; I wonder if this leaves the file contents in memory or overwrites them with 0s.

@MichaelGHSeg MichaelGHSeg merged commit 7a8a1bf into main Aug 14, 2024
4 checks passed
@MichaelGHSeg MichaelGHSeg deleted the MichaelGH/syncfilewrites branch August 14, 2024 14:26
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.

3 participants