Zip fails

I have problem with this code:

set from_here to quoted form of (POSIX path of (path to desktop) & "/8721/")
set to_here to quoted form of (POSIX path of (path to desktop) & "/testing.zip")

do shell script ("zip - " & from_here & " > " & to_here)

Folder 8721 has 2 items, one is file and another is folder.

This code creates empty zip file, but if i remove one of those 2 items, then it works.

Another problem is that it zips full folder path leading to those 2 items what i want to zip. I would prefer that in top level of zip-file is those 2 items.

I think I would write it this way:

set from_here to quoted form of (POSIX path of (path to desktop) & "/8721/")
set to_here to quoted form of (POSIX path of (path to desktop) & "/testing.zip")

do shell script ("cd " & from_here & " && zip -r " & to_here & " .")

First, cd into the source directory so that the stored path names are relative to the source directory. Second, use “.” as the file-to-archive argument to tell zip to archive the current working directory (as established by cd). To make sure it actually processes to contents of the directory, not just the directory itself, use “-r” to recursively archive everything in the source directory.

With a directory structure like this:[code].
|-- bar
| -- bar – foo

1 directory, 2 files[/code]
I get a zip file with this listing (unzip -v testing.zip):[code]Archive: …/testing.zip
Length Date Time Name


    0  11-20-09 22:47   bar/
    4  11-20-09 22:47   bar/bar
    4  11-20-09 22:56   foo

    8                   3 files[/code]