gretl_zip

gretl_zip

Functions

Description

Functions

gretl_unzip ()

int
gretl_unzip (const char *fname);

Unzips fname in the current directory, preserving any internal directory structure.

Parameters

fname

name of the file to unzip.

 

Returns

0 on success, non-zero code on error.


gretl_unzip_into ()

int
gretl_unzip_into (const char *fname,
                  const char *dirname);

Unzips fname in the specified directory, preserving any internal directory structure.

Parameters

fname

name of the file to unzip.

 

dirname

the name of the directory in which unzipping should take place.

 

Returns

0 on success, non-zero code on error.


gretl_unzip_session_file ()

int
gretl_unzip_session_file (const char *fname,
                          gchar **zdirname);

Specialized (slightly) unzipper for gretl session files.

Parameters

fname

name of the file to unzip.

 

zdirname

location to receive the name of the top-level directory within the zip archive.

 

Returns

0 on success, non-zero code on error.


gretl_make_zipfile ()

int
gretl_make_zipfile (const char *fname,
                    const char *path);

gretl_zip_datafile ()

int
gretl_zip_datafile (const char *fname,
                    const char *path,
                    int level);

Creates a zip file of the specified name, with content given by path , using the specified compression level.

Parameters

fname

name of the zip file to create.

 

path

the path to the content which should be zipped.

 

level

the zlib compression level to apply.

 

Returns

0 on success, non-zero code on error.


package_make_zipfile ()

int
package_make_zipfile (const char *gfnname,
                      int pdfdoc,
                      char **datafiles,
                      int n_datafiles,
                      gchar **pzipname,
                      const char *dest,
                      gretlopt opt,
                      PRN *prn);

Collects the specified gfn file plus any additional files it references (PDF doc and/or data files) and makes a zip archive, using the user's "dotdir" as workspace. If pzipname is non-NULL this is taken as signal to leave the zipfile where it has been created, and to "return" its full path via this pointer. Otherwise, if dest is non-NULL it is taken to stipulate a path to which the zipfile should be moved/renamed.

Errors are flagged if both pzipname and dest are NULL, if gfnname does not have the ".gfn" extension, or if the basename of the gfn file (minus extension) is over 32 bytes long.

Parameters

gfnname

name of the gfn file to be zip-packaged.

 

pdfdoc

package has PDF documentation? (0/1).

 

datafiles

names of any data files to include (or NULL).

 

n_datafiles

the number of strings in datafiles .

 

pzipname

location to receive "dotdir" zipname, or NULL.

 

dest

specific path for output zipfile, or NULL.

 

opt

use OPT_G for GUI use (only);

 

prn

gretl printer for progress.

 

Returns

0 on success, non-zero code on error.

Types and Values