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

Use the parent dir of target files as the dir for temp files #81

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

sile
Copy link
Owner

@sile sile commented Sep 14, 2022

When $ efmt --write /path/to/file.erl is executed, the current master branch create a temporary file in the system temp dir (e.g., /tmp/) to write the formatted result. Then, it renames the temp file with the input file (/path/to/file.erl in this case).
A problem is that there is not guarantee that both the input and temp files are located in the same filesystem. If it isn't, the rename operation would fail.
This PR changes the temp file dir to the parent dir of input files to fix this problem.

@sile sile merged commit 9d10ec7 into master Sep 14, 2022
@sile sile deleted the fix-cross-fs-tempfile branch September 14, 2022 23:23
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.

1 participant