8000 refactor: using standard libraries to do file operations by apocelipes · Pull Request #542 · boyter/scc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: using standard libraries to do file operations #542

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

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

apocelipes
Copy link
Contributor

Using standard libraries to get temp path and to do file operations.

This makes the program more simple and safer because standard libraries clean the path and no need to use outside commands.

It also makes the code more portable since not all systems use '/tmp' as its tempfile path (other places for example, '/data/local/tmp'). Many mordern Linux distros also support setting the env varibale '$TMPDIR' to change a program's tempfile path. So using the standard library's getTempDir function is a better idea, it's done all the works for us.

@boyter
Copy link
Owner
boyter commented Oct 22, 2024

Merging in although I never plan on running the Python script again and the Go code is exclusively running on linux. Thanks for the PR though!

@boyter boyter merged commit aa904f4 into boyter:master Oct 22, 2024
5 checks passed
@apocelipes apocelipes deleted the use-os branch October 22, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

2 participants
0