inguardians/VaporTrail

Cross platform receive script (mktemp)

Opened this issue · 1 comments

mktemp -p isn't crossplatform

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.