tempfile.nim
tempfile.nim copied to clipboard
This module contains basic procs for creating temporary files and directories
this [answer](https://unix.stackexchange.com/questions/181937/how-create-a-temporary-file-in-shell-script/181938#181938) uses a nice trick to guarantee auto cleanup: ``` tmpfile=$(mktemp /tmp/abc-script.XXXXXX) exec 3>"$tmpfile" rm "$tmpfile" : ... echo foo >&3 ``` the cleanup would happen even if a...
module [random](https://nim-lang.org/docs/random.html) from stdlib requires a call to randomize in order to have random results that change at every call. Indeed the following: ```nim import std / random echo rand(100)...