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

Cross platform receive script (mktemp) #12

Open
faithanalog opened this issue Oct 19, 2017 · 1 comment
Open

Cross platform receive script (mktemp) #12

faithanalog opened this issue Oct 19, 2017 · 1 comment

Comments

@faithanalog
Copy link

mktemp -p isn't crossplatform

@zenfish
Copy link

zenfish commented Feb 6, 2021

You don't even need mktemp to make a temp file in the current dir... you could use something like rawfile=$(/bin/date +"%Y.%m.%d.%H.%M.%S".$$), which creates a temp file with the name "year.month.day.hour.min.sec.PID" of the current process, which for your purposes should be fine (you just remove it at the end of the script.) mktemp is useful for security (mostly avoiding race conditions/symlink attacks) but there's not much of a need for that here... you could even insert $HOME in the front of that if you're really paranoid. Or... just use mktemp w/o the -p flag, which unless you run out of temp space, would be fine for linux/mac as well.

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

No branches or pull requests

2 participants