Hi I try to using the application ZIP by command line (for a futur planning), I can zip but when create a zip with all path it create all the path in the zipfile I don’t want it…
Example with this command:
zip -r -9 -J main.c /boot/home/TestLove/*
that create a /boot/home/TestLove/ directory in the zip itself and I don’t want it I just want the main.c here is just an example. I want make it possible to zip an entire directory also.
Hi thanks the -j option erase all the subdirectory in the archive that’s near but I want in my case
if I have a directory like this into:
main.c
/pictures/picture.png
I want it like the previous hierarchy in the zip file and not to have this:
/boot/home/Test/picture/picture.png
/boot/home/Test/main.c
-j erase the directory picture and do
main.c
picture.png
I must maybe go to the directory as a root directory but chroot command don’t work like I want here
I have try chroot /boot/home/Test/ zip but it say no suck file or directory about “zip”
Ok I will try with the cd command maybe that will work
It looks like your problem partially arises from the zip command always using the second non-switch argument as the path to zip up. So your first example asks it to make a file called ‘main.c’ and zip the -path- ‘/boot/home/TestLove’ and all the files in the last directory.
Are you expecting the command to zip files from anywhere as though you were inside the directory you want to zip up? Because that seems a little counterintuitive based on the described behavior. Since I haven’t used that command in Haiku, I’m curious as to what happens if you do this:
zip -r -9 -J /boot/home/Test/main.zip *
or
zip -9 -J /boot/home/Test/main.zip *
If it’s just exactly the same as Unix/Linux zip then you may want to review the help file and double check that you’re using the command correctly (for the desired outcome). Specifying ‘-r’ for recursive travel through the path is likely what was causing it to re-create the /boot/home/TestLove/ path inside the zip file.