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

Write output to a temp file and rename it afterwards. #26

Merged
merged 1 commit into from
Jan 17, 2017

Conversation

robryk
Copy link
Contributor

@robryk robryk commented Jan 17, 2017

Fixes #20

@robryk
Copy link
Contributor Author

robryk commented Jan 17, 2017

PTAL

@@ -196,12 +196,6 @@ int main(int argc, char** argv) {
return 1;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe close fin here?

Copy link
Contributor Author

@robryk robryk Jan 17, 2017

Choose a reason for hiding this comment

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

Done. Not here, because the file is used later.

This will prevent us from failing when the output and input file are the
same file. It will also prevent us from truncating the output file if
e.g. parsing of the input file fails.

This causes us to fail late if the output file is not writable, though.

Fixes google#20.
@robryk robryk merged commit fec9058 into google:master Jan 17, 2017
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