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

Writes config to temp file then renames to dest #3

Merged
merged 1 commit into from
Jul 22, 2016
Merged

Writes config to temp file then renames to dest #3

merged 1 commit into from
Jul 22, 2016

Conversation

retrohacker
Copy link
Contributor

This protects against corrupting the configuration file if the
application crashes before the stream finishes writing to the file

Especially important for large configuration files

This protects against corrupting the configuration file if the
application crashes before the stream finishes writing to the file

Especially important for large configuration files
@feross
Copy link
Collaborator

feross commented Jul 22, 2016

This is a real issue. Thanks for the PR to fix it.

@feross feross merged commit 14a70d2 into LinusU:master Jul 22, 2016
@feross
Copy link
Collaborator

feross commented Jul 23, 2016

I made a change so the temp file retains the same extension (.json, etc.) and added a dash for readability of the file name.

Example: /Users/feross/Library/Application Support/linusu-test/config.json-372214031065653871469233076840.json

Released as 1.0.0.

feross added a commit to webtorrent/webtorrent-desktop that referenced this pull request Jul 23, 2016
This protects against corrupting the configuration file if the
application crashes before the stream finishes writing to the file

Especially important for large configuration files

See LinusU/node-application-config#3
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