Benches macOS

6

zip -r

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

hello,

normally zip -r works fine for me but this code will return zip file structure invalid error:


zip -r directory.named.foo directory.named.foo

if the name of the directory did not include the "." there would be no issue. i see in man zip that the "." is not recommended with the -r flag but i couldn't quite figure out the alternative. i see the finder can do it so i'm sure there must be a way. 🙂 any help is appreciated.

thanks,

rick

6 replies

Sign in or join Beachball Help to reply.

  1. 0

    Kappy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Have you tried putting the entire name in quotes, e.g., "directory.named.foo"?

  2. 0

    rick722

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    thanks kappy for the reply. unfortunately it's the same either way...

    rick

  3. 0

    Kappy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Guess that means you can't use the "." in a path name with that command line option. Have you tried other zip utilities than the one you are using? Must you use a Unix command because there are numerous GUI based utilities like Zipeg - VersionTracker or MacUpdate.

  4. 0

    Nils C. Anderson

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Did you try

    zip -r <name of zip archive file> <directory to be zipped>

    zip -r directory.named.foo.zip directory.named.foo/

  5. 0

    Linc Davis

    Imported from the Apple Support Forums via the Wayback Machine 🔗


    $ mkdir directory.named.foo
    $ touch !$/file1
    touch directory.named.foo/file1
    $ zip directory.named.foo directory.named.foo
    zip warning: missing end signature--probably not a zip file (did you
    zip warning: remember to use binary mode when you transferred it?)
    zip error: Zip file structure invalid (directory.named.foo)
    $ zip directory.named.foo.zip directory.named.foo
    adding: directory.named.foo/ (stored 0%)
    $ touch directory.named.foo/file2
    $ zip -r directory.named.foo.zip directory.named.foo
    updating: directory.named.foo/ (stored 0%)
    adding: directory.named.foo/file1 (stored 0%)
    adding: directory.named.foo/file2 (stored 0%)

  6. 0

    rick722

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    thank you all for the replies and yes as the last 2 posts showed it should have the .zip extension just that it wasn't exposed as a problem until i encountered directories with a dot. thank you i was sure there was a simple solution somewhere i was overlooking...

    rick