]> git.ipfire.org Git - thirdparty/sarg.git/blob - documentation/decomp.txt
Z files are uncompressed by zcat to avoid deleting the original log file.
[thirdparty/sarg.git] / documentation / decomp.txt
1 /*!\file decomp.c
2 \brief Handle compressed log files.
3 */
4
5 /*! \fn void decomp(char *arq, char *zip, const char *tmp)
6 Uncompress a compressed log file or does nothing if the file does not end with a known extension.
7
8 Log files compressed with gzip, bzip2 or compress are uncompressed to the file sarg-file.in in the temporary directory and sarg-file.in is deleted with the whole temporary directory when sarg terminates.
9
10 If the log file does not exist, the process terminates with an error message.
11
12 \param arq The log file to process. Upon return it contains the name of the file to read.
13 \param zip A string to copy the compression program to use to recompress the file. It will determine if and how to recompress the log file.
14 \param tmp The temporary directory where to create the uncompressed log file if the compression program support it. The suffix "/sarg" is added to the temporary directory to use the same directory layout as the rest of the program.
15
16 \date 2009-09-24 - F Marchal\n
17 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 */
19
20
21
22
23 /*! \fn void recomp(const char *arq, const char *zip)
24 Compress the log file uncompressed by decomp().
25
26 \param arq The log file to compress.
27 \param zip The program to compress the log file. Only gzip and compress actually compress the log file. Any other string has no effect.
28
29 \date 2009-09-24 - F Marchal\n
30 This function is not necessary any more because decomp() does not uncompress the log files in place.
31 */