From ab534ee345d813b59bef18fd90fa910d75444018 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jul 22 2012 21:57:01 +0000 Subject: Update `Functions/Commons/cli_getTemporalFiles.sh': - Start using mktemp to create temporal files. Based on mktemp's man page, using mktemp is the recommended way of creating temporal files. --- diff --git a/Scripts/Bash/Functions/Commons/cli_getTemporalFile.sh b/Scripts/Bash/Functions/Commons/cli_getTemporalFile.sh index 89c9ae2..318ac35 100755 --- a/Scripts/Bash/Functions/Commons/cli_getTemporalFile.sh +++ b/Scripts/Bash/Functions/Commons/cli_getTemporalFile.sh @@ -38,20 +38,8 @@ function cli_getTemporalFile { cli_printMessage "`gettext "The first argument cannot be empty."`" --as-error-line fi - # Redefine file name for the temporal file. Make it a combination - # of the program name, the program process id, a random string and - # the design model name. Using the program name and process id in - # the file name let us to relate both the shell script execution - # and the temporal files it creates, so they can be removed in - # case an interruption signal be detected. The random string let - # us to produce the same artwork in different terminals at the - # same time. the The design model name provides file - # identification. - NAME=${CLI_NAME}-${CLI_PPID}-${RANDOM}-${NAME} - - # Define absolute path for temporal file using the program name, - # the current locale, the unique identifier and the file name. - local TEMPFILE="${CLI_TEMPDIR}/${NAME}" + # Define absolute path for temporal file. + local TEMPFILE="$(mktemp ${CLI_TEMPDIR}/${NAME}.XXXXXXXXXX)" # Output absolute path to final temporal file. echo $TEMPFILE