Thank you Jim and Philip for your replies.
On Mar 20, 2006, at 3:26 PM, Jim Tittsler wrote:
> On Mar 20, 2006, at 10:25, Nobumi Iyanaga wrote:
>> And this created a zip file named "man_viewer.zip"; double-
>> clicking on it (in another folder), it created "man_viewer.app",
>> but it had only a generic application icon (the original
>> "man_viewer.app" is an AppleScript application); double-clicking
>> on it, it did nothing..., and it is not an application bundle. I
>> guess it is this "bundle" format which is the cause of this
>> problem. Could you show me how I would be able to zip an
>> application?
>
> The "bundle" is a directory tree. Try using the -r switch:
> zip -r man_viewer man_viewer.app
>
Thank you. I tried it, and it works -- except for AppleScript non-
bundle application. I think it is because of the resource fork....
> The pattern match used for -x includes the path, so try:
> zip -r images images -x "*/.*"
> or
> zip -r images images -x \*.DS_Store
I tried these, and they work very well also.
> (Also note that the backslash is one of the ways of escaping the
> '*' from the shell's expansion. It is not necessary to escape the
> '.')
Ah, thank you. This is the kind of info I need...!
On Mar 21, 2006, at 12:09 AM, Philip Aker wrote:
> On 2006-03-19, at 17:25:53, Nobumi Iyanaga wrote:
>
>> I tried these commands, and they worked just as expected. So, if
>> I understand well, this means that the second argument is the
>> "object" of the command, and the first argument is the name of the
>> resulting zip file to which the extension (".zip") is added
>> automatically...??
>
> Yes. Often the unix tool man pages use terms such as "input, "in",
> or, "src", for "object" as you say above. And for the result, some
> terms used are "output", "out", and "dst".
Thank you!
>
>
>> One thing I tried and could not get the expected result is to zip
>> an application. I tried:
>
>> cd ~/Desktop
>> zip man_viewer man_viewer.app
>
>
> Jim Tittsler has answered your questions very well.
>
> Another option might be to use:
>
> /System/Library/CoreServices/BOMArchiveHelper.app/Contents/MacOS/
> BOMArchiveHelper ~/Desktop/some.app
This worked well for an AppleScript non-bundle application as well.
The resource fork in Mac OS X is really tricky...!
>
> From Script Editor, a 'do shell script' is:
>
> set input to POSIX path of ((path to desktop as string) & "some.app")
> do shell script "open -a BOMArchiveHelper " & input
Ah, this is very good to know!
>
> This is the application which the Finder contextual menu item uses
> but I don't know how to supply it any options so the result file is:
>
> ~/Desktop/some.app.cpgz
>
>
> Showing us that BOMArchiveHelper.app is probably a wrapper around
> the tool 'cpio' (see man cpio for details). Most likely with some
> extra code to handle resource forks. However, do not change the
> resulting file extension to 'zip'. You'll get a messy output.
I looked at man cpio, but I could not get it work. I tried:
cd ~/Desktop
cpio -o -z < man_viewer.app > man_viewer
but I got:
cpio: Invalid file name arguement
cpio: Unable to access ???? <Invalid argument>
cpio: Unable to access J9J <No such file or directory>
cpio: WARNING! These file names were not selected:
????
J9J
Anyway, thank you very much!
Best regards,
Nobumi Iyanaga
Tokyo,
Japan
|