Top | ![]() |
![]() |
![]() |
![]() |
void | (*GebrTarFunc) () |
GebrTar * | gebr_tar_create () |
void | gebr_tar_append () |
gboolean | gebr_tar_compact () |
GebrTar * | gebr_tar_new_from_file () |
const gchar * | gebr_tar_get_dir () |
gboolean | gebr_tar_extract () |
void | gebr_tar_foreach () |
void | gebr_tar_free () |
void gebr_tar_append (GebrTar *self
,const gchar *path
);
Inserts path
into the tar represented by self
. After you inserted
all files, call gebr_tar_compact()
to generate the tar file.
self |
a GebrTar created with |
|
path |
a path for a file accessible through |
gboolean gebr_tar_compact (GebrTar *self
,const gchar *root_dir
);
Compacts the files into a gziped tar. The root_dir
specifies the directory in
which files are searched for. The root_dir
is equivalent to the -C option of
tar command line.
self |
a GebrTar created with |
|
root_dir |
the directory in which files are searched for |
GebrTar *
gebr_tar_new_from_file (const gchar *path
);
Creates a GebrTar from an existing file on the system.
You can call gebr_tar_extract()
on this object.
gboolean
gebr_tar_extract (GebrTar *self
);
If the GebrTar was created with gebr_tar_new_from_file()
constructor, then you
can extract it by calling this function on it. The extraction is done in a temporary
folder. To access the files you should use the gebr_tar_foreach()
method.
The temporary folder is deleted when gebr_tar_free()
is called.
void gebr_tar_foreach (GebrTar *self
,GebrTarFunc func
,gpointer data
);
Calls func
for each file inside the tar file represented by self
. You should
process the file here, ie move, copy, modify to any place. Notice that the files
are extracted into a temporary folder, which will be deleted upon gebr_tar_free()
call, so don't rely on them!
self |
a GebrTar object, after |
|
func |
a function to be called for each file in |
|
data |
data to pass to |
void
gebr_tar_free (GebrTar *self
);
If self
was extracted with gebr_tar_extract()
, then this function will remove
all extracted files. After that the structure is freed.