I have a file that placed in the following directory:
folder_A/another_folder_A/file_to_add.xml
Now, what I want to do is simply add the file to a folder in an existing zip archive.
For example this is my zip content:
my_zip.zip/folder_B/another_folder_B
How can I add the file_to_add.xml
to the another_folder_B
?
my_zip.zip/folder_B/another_folder_B/file_to_add.xml
I don't want to create folders with the same names and add them. Is there a command that allow me to do that?
Best Answer
Do not know a way to do this by
7z
orzip
tools directly. But, guess most libraries like perl, python etc has azip
module. You can't, however do it in Bash.Here is a simple example in PHP:
Test case:
Usage:
Code:
(Have not coded PHP in a long time. The code is anyhow only meant as an example to be expanded or other.)