tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Change to genassym to use mktemp(1) to create tempdir



On Mon, 6 Jan 2014, J.T. Conklin wrote:

> -genassym_temp=/tmp/genassym.$$
> +genassym_temp=`mktemp -d -q ${TMPDIR-/tmp}/genassym.XXXXXX`
>  
> -if ! mkdir $genassym_temp; then
> +if ! test -d $genassym_temp; then
>       echo "${progname}: unable to create temporary directory" >&2
>       exit 1
>  fi

This seems fine to me.

But maybe don't use -q and let it fail at same time:

 genassym_temp=`mktemp -d ${TMPDIR-/tmp}/genassym.XXXXXX` || {
       echo "${progname}: unable to create temporary directory" >&2 ;
       exit 1
 }


Home | Main Index | Thread Index | Old Index