7z won't handle both `-i@file.lst` and -snl options correctly
A free file archiver for extremely high compression
Brought to you by:
ipavlov
Basically, I'd want to be able to list some directories in file.lst
that are symlink, but as the -snl
option suggests it, I want the link to be added to the archive and not the whole directory content.
zip
does it the right way, because it makes a distinction between path/to/dir
and path/to/dir/*
.
Note that this is also true for files, as 7z
will try to add the actual file to the archive instead of just the link.
I guess for files it'd be easy to fix this, but for directories it would be harder, since 7z
accepts both formats mentioned above to target "the directory and its content".
why
file.lst
?you can write names in command without file list.
Show simplest and smallest command that doesn't work as you expect.
Context:
The command is:
7z a -snl -i@file.lst test.zip
I expect 7zip to create a zip archive with only one file which is a symlink (because I set
-snl
). What it contains is an archive with one file, which is namedfile
, which contains the content of/tmp/test
. So it is not a symlink, which is what I would have expected.What version of 7-zip?
-snl
switch to store symbolic links as links (WIM and TAR formats only).Last edit: Igor Pavlov 2023-10-25
Interesting. A few remarks:
1. From the linux command line we can read "-snl : store symbolic links as links". Same thing for the man page.
2. Running
7za a -snl -tzip test.zip test_dir/
will storetest_dir/file
as a symbolic link, so as I expect it to do.Am I misunderstanding something here?
I don't update old version16.02.
You can use 7-Zip ver 23.01 instead from www.7-zip.org
Indeed, both options actually seem to work on newer versions of
7zip
, my bad...Thanks a lot for helping!