If I do:
and then I go to test_subdir_2 in Finder and try to open test_archive.zip, I get:
However, if I extract test_archive.zip with The Unarchiver, it gives me __Parent__/test_subdir_1/test_file.txt. And, I can do:
I don't have this problem if I create the zip archive in the directory containing the files.
macOS 11.0.1
Any idea why I have this problem with Finder or how I can avoid it? Is this a bug?
Thanks!
Code:
$ cd ~/Desktop
$ mkdir test_dir
$ cd test_dir/
$ mkdir test_subdir_1 test_subdir_2
$ touch test_subdir_1/test_file.txt
$ cd test_subdir_2/
$ zip test_archive.zip ../test_subdir_1/*
adding: ../test_subdir_1/test_file.txt (stored 0%)
and then I go to test_subdir_2 in Finder and try to open test_archive.zip, I get:
However, if I extract test_archive.zip with The Unarchiver, it gives me __Parent__/test_subdir_1/test_file.txt. And, I can do:
Code:
$ unzip test_archive.zip
Archive: test_archive.zip
warning: skipped "../" path component(s) in ../test_subdir_1/test_file.txt
extracting: test_subdir_1/test_file.txt
$ ll
total 8
-rw-r--r-- 1 Thomas staff 210 Feb 13 23:23 test_archive.zip
drwxr-xr-x 3 Thomas staff 96 Feb 13 23:23 test_subdir_1
$ ll test_subdir_1/
total 0
-rw-r--r-- 1 Thomas staff 0 Feb 13 23:23 test_file.txt
I don't have this problem if I create the zip archive in the directory containing the files.
macOS 11.0.1
Code:
$ zip -v
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Any idea why I have this problem with Finder or how I can avoid it? Is this a bug?
Thanks!