Skip to content

Manually delete cacheFile before we write to it #120

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

Conversation

wangmengyan95
Copy link
Contributor

No description provided.

@grantland
Copy link
Contributor

What use cases does this fix? It seems like if we're not able to write to the file, we wouldn't be able to delete it either.

@wangmengyan95
Copy link
Contributor Author

If the cacheFile exists, when we call ParseFileUtils.moveFile(tempFile, cacheFile), an IOException will be thrown. We delete it manually to make sure it does not exist before we move tempFile.

@grantland
Copy link
Contributor

Ah I see. LGTM!

wangmengyan95 added a commit that referenced this pull request Sep 10, 2015
…FileController_delete_cache_file_before_move_temp_file

Manually delete cacheFile before we write to it
@wangmengyan95 wangmengyan95 merged commit 29a3795 into master Sep 10, 2015
@wangmengyan95 wangmengyan95 deleted the wangmengyan.t8184922_ParseFileController_delete_cache_file_before_move_temp_file branch September 10, 2015 22:56
@facebook-github-bot
Copy link

@wangmengyan95 updated the pull request.

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