This module contains functions to manipulate archives.
This module can manipulate:
The default archive format is zip, to ensure platform interoperability, and also because this is the qiBuild package format.
All archives should have a unique top directory.
To enforce platform interoperability :
Compress directory in an archive
Parameters: |
|
---|---|
Returns: | path to the generated archive |
Extract a an archive into directory
Parameters: |
|
---|---|
Returns: | path to the extracted archive (directory/topdir) |
If the content is archiving relatively to ”.” or “/”, then this leading field of the path is replace by the archive name.
If several directories or files are stored at the root of the archive, then they will be extracted in a directory maned using the archive name.
e.g.:
Wrong leading field in paths:
Archive content:
./foo
./foo/bar
./foo/bar/bar.txt
./foo/baz.txt
Extracted location:
directory/archive_name/foo
directory/archive_name/foo/bar
directory/archive_name/foo/bar/bar.txt
directory/archive_name/foo/baz.txt
Several items at the root of the archive:
Archive content:
foo
foo/bar
foo/bar/bar.txt
baz.txt
Extracted location:
directory/archive_name/foo
directory/archive_name/foo/bar
directory/archive_name/foo/bar/bar.txt
directory/archive_name/baz.txt
Guess the compression algorithm from the archive filename
Parameters: | archive – path of the archive |
---|---|
Returns: | the compression algorithm name |