cope with cwd being specified in readfile
drive mktemp in a way which works on Ubuntu 12