Uses gunzip to uncompress a file compressed with gzip.
Related functions: edmiCompressFile
Header:
#include "sdai.h"
Prototype:
EdmiError edmiUncompressFile(SdaiString compressedFile,
SdaiString unCompressedFile,
SdaiReal *rate);
Arguments:
compressedFile |
Name of the compressed file. |
unCompressedFile |
Name of the uncompressed file. |
rate |
Returns the compression rate. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiReal rate;
SdaiString file = "c:/home/johnny/b43_765.stp";
SdaiString compFile = "c:/home/johnny/ b43_765.stp.zip";
. . .
/* Compress */
if (rstat = edmiCompressFile(file, compFile, 4, &rate)) {
printf("\nError %d in edmiCompressFile: %s", rstat,
edmiGetErrorText(rstat));
goto error;
}
printf("\nCompressed %s with Compression Rate: %f", file, rate);
. . .
/* Uncompress */
if (rstat = edmiUncompressFile(compFile, file, &rate)) {
printf("\nError %d in edmiUncompressFile: %s", rstat,
edmiGetErrorText(rstat));
goto error;
}
printf("\nUncompressed %s, Compression Rate: %f", compFile, rate);
. . .