inguardians / VaporTrail

Written by InGuardians' Faith Alderson and Larry Pesce, VaporTrail is a tool for data transmission over FM, using RPITX to transmit from an out-of-the-box Raspberry Pi, and an RTL-SDR to receive. Twitter handles: @unknownloner, @haxorthematrix, @inguardians
http://vaportrail.io
Other
48 stars 8 forks source link

Cross platform receive script (mktemp) #12

Open faithanalog opened 6 years ago

faithanalog commented 6 years ago

mktemp -p isn't crossplatform

zenfish commented 3 years ago

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.