unzipuno.cpp

Ir a la documentación de este archivo.
00001 // vim: set expandtab tabstop=8 shiftwidth=8 foldmethod=marker:
00013 #include "funzipuno.hpp"
00014 #include <iostream>
00015 
00016 using namespace std;
00017 
00022 int
00023 main(int argc, char **argv)
00024 {
00025         char nomout[PATH_MAX];
00026         FILE *in, *out;
00027 
00028         /* if no file argument and stdin not redirected, give the user help */
00029         if (argc != 4 && isatty(0))   {
00030                 cerr << "unzipuno zip archivo dir" << endl;
00031                 cerr << "  zip es contenedor ZIP" << endl;
00032                 cerr << "  archivo es archivo que se espera en contenedor zip"
00033                 << endl;
00034                 cerr << "  dir Directorio donde se descomprimirá" << endl;
00035                 exit(3);
00036         }
00037 
00038         if ((in = fopen(argv[1], "rb")) == (FILE *)NULL) {
00039                 err(2, "cannot find input file");
00040         }
00041         snprintf(nomout, PATH_MAX, "%s/%s", argv[3], argv[2]);
00042         if ((out = fopen(nomout, "wb")) == (FILE *)NULL) {
00043                 err(2, "cannot write to output file");
00044         }
00045         unzipUno(in, argv[2], out);
00046         fclose(in);
00047         fclose(out);
00048 
00049         return 0;
00050 }

Generado el Wed Jan 6 06:58:22 2010 para Mt77 por  doxygen 1.5.4