bash - add files to subfolder inside zip when creating -


i following on linux bash script:

zip file file1.jar new archive inside of subdirectory.

given: myfiletozip.jar

expected:

  • ./myfiletozip.jar
  • ./myarchive.zip
    • | /mods/
      • | /myfiletozip.jar

is possible add non existant path during creation? or have create temp way @ filelevel before zipping?

i have no memory of option allows create zip file non existent directory inside.

but php can create in advance empty zip file empty non existent directory, , after can update file real files/structures want.

run first script php myscript.php

<?php $zip = new ziparchive(); $zip->open('my-archive.zip', ziparchive::create); $zip->addemptydir('./dir1/subdira'); $zip->addemptydir('./dir2/subdirb'); $zip->close(); ?> 

and after

zip -u my-archive.zip path_to_add 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -