Check of tmp folder creation was successful

This commit is contained in:
fritz-hh 2014-01-13 22:05:26 +01:00
parent f581a55544
commit 317846fbdc
2 changed files with 6 additions and 1 deletions

View File

@ -210,7 +210,11 @@ fi
today=$(date +"%Y%m%d_%H%M")
fld=$(basename "$FILE_INPUT_PDF" | sed 's/[.][^.]*$//')
prefix="${today}.filename.${fld}"
TMP_FLD=`TMPDIR=${TMP} mktemp -d -t "${prefix}"`
TMP_FLD=`TMPDIR=${TMP} mktemp -d -t "${prefix}"` # create temporary sub-folder in $TMP folder
if [ $? -ne 0 ]; then
echo "Could not create folder for temporary files. Please ensure you have sufficient right and \"$TMP\" exists"
exit $EXIT_FILE_ACCESS_ERROR
fi
FILE_TMP="${TMP_FLD}/tmp.txt" # temporary file with a very short lifetime (may be used for several things)
FILE_PAGES_INFO="${TMP_FLD}/pages-info.txt" # for each page: page #; width in pt; height in pt
FILE_OUTPUT_PDF_CAT="${TMP_FLD}/ocred.pdf" # concatenated OCRed PDF files

View File

@ -6,6 +6,7 @@ EXIT_BAD_ARGS="1"
EXIT_BAD_INPUT_FILE="2"
EXIT_MISSING_DEPENDENCY="3"
EXIT_INVALID_OUPUT_PDFA="4"
EXIT_FILE_ACCESS_ERROR="5"
EXIT_OTHER_ERROR="15"
# possible log levels