TEXT   31
Guest on 10th March 2023 12:20:48 AM

  1. /*!\file decomp.c
  2. \brief Handle compressed log files.
  3. */
  5. /*! \fn FILE *decomp(const char *arq, bool *pipe)
  6. Open the log file. If it is compressed, uncompress it through a pipe.
  8. Log files compressed with gzip, bzip2 or compress are uncompressed with zcat or bzcat.
  10. If the log file does not exist, the process terminates with an error message.
  12. \param arq The log file to process.
  13. \param pipe A variable set to \c true if the log file is opened through a pipe or set to \c false if the file is open directly.
  15. \date 09-24 - F Marchal\n
  16. This function used to uncompress .Z files in place using uncompress but that required a write access to the log directory, could conflict with logrotate and could leave the log file uncompressed if sarg crashed. According to the documentation, zcat is capable of uncompressing .Z files so it is now used.
  18. \date 05-10 - F Marchal\n
  19. The function doesn't use a temporary file any more and read the compressed file through a pipe.
  20. */

Raw Paste

Login or Register to edit or fork this paste. It's free.