home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
sarg1221.zip
/
decomp.c
< prev
next >
Wrap
C/C++ Source or Header
|
2002-06-13
|
1KB
|
62 lines
#include "include/conf.h"
void decomp(char *arq, char *zip)
{
char cmd[1024];
if(access(arq, R_OK) != 0) {
sprintf(cmd,"%s: %s",text[64],arq);
debuga(cmd);
exit(1);
}
if(strstr(arq,".gz") != 0) {
sprintf(cmd,"%s: %s (gzip)",text[62],arq);
debuga(cmd);
sprintf(cmd,"gzip -d %s",arq);
system(cmd);
arq[strlen(arq)-3]='\0';
strcpy(zip,"gzip");
return;
}
if(strstr(arq,".Z")) {
sprintf(cmd,"%s: %s (uncompress)",text[62],arq);
debuga(cmd);
sprintf(cmd,"uncompress %s",arq);
system(cmd);
arq[strlen(arq)-2]='\0';
strcpy(zip,"compress");
}
return;
}
void recomp(char *arq, char *zip)
{
char cmd[1024];
if(access(arq, R_OK) != 0) {
sprintf(cmd,"%s: %s",text[64],arq);
debuga(cmd);
exit(1);
}
sprintf(cmd,"%s: %s",text[63],arq);
debuga(cmd);
if(strcmp(zip,"gzip") == 0)
sprintf(cmd,"%s %s",zip,arq);
if(strcmp(zip,"compress") == 0)
sprintf(cmd,"%s %s",zip,arq);
system(cmd);
return;
}