#****************************************************************************
#  ##   ##         #####   #####  ##     **      NoSQL RDBMS - tempfile     *
#  ###  ##        ####### ####### ##     **        $Revision: 2.1 $			*
#  #### ##        ###     ##   ## ##     ************************************
#  #######  ####  #####   ##   ## ##     **      Carlo Strozzi (c) 1998     *
#  ####### ######   ##### ## # ## ##     ************************************
#  ## #### ##  ##     ### ##  ### ##     **           Written by            *
#  ##  ### ###### ####### ######  ###### **          Carlo Strozzi          *
#  ##   ##  ####   #####   #### # ###### **     e-mail: carlos@linux.it     *
#****************************************************************************
#   NoSQL RDBMS, Copyright (C) 1998 Carlo Strozzi.                          *
#   This program comes with ABSOLUTELY NO WARRANTY; for details             *
#   refer to the GNU General Public License.                                *
#****************************************************************************
#
# Built-in temporary file creator program for NoSQL.
#
# Usage:  nosql tempfile
#
# NoSQL replacement for temporary file creation utilities like tempfile(1),
# mktemp(1) and that, for those systems that do not provide them.
# The use of those utilities is _highly_ recommended over this trivial
# script.
#
##########################################################################

umask 177

a=0

tmp_stem=${TMPDIR:-/tmp}/$$xxx

while [ -f ${tmp_stem}$a ]
do
  a=`expr $a + 1`
done

touch ${tmp_stem}$a
echo ${tmp_stem}$a

