zmktemp 419 B

12345678910111213141516
  1. #!/bin/bash
  2. #
  3. # Generate Kopano temporary file
  4. #
  5. # attachments_parser will have provided the ${TMPDIR}
  6. # which means that we will generate the following temporary
  7. # file directly in a subfolder which will be cleaned up by
  8. # attachments_parser.
  9. TMPFILE="`mktemp`"
  10. # Write data from standard input directly into temporary file.
  11. cat > ${TMPFILE}
  12. # Caller needs to be informed on where the data went to.
  13. echo ${TMPFILE}