mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-12-28 23:49:33 +00:00
Check of tmp folder creation was successful
This commit is contained in:
parent
f581a55544
commit
317846fbdc
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user