Re: Zippin'
Re: Zippin'
- Subject: Re: Zippin'
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 25 Mar 2011 10:24:31 -0400
Well, you're looking for the functionality of the Finder's
archive-folder command, which gives you more than zip(1) does. That's
what the ditto(1) command was created to do; it's Apple's extended
version of zip.
You can certainly use plain old zip if all you want is to archive a
folder. This 3-line shell script does what I think you're asking for,
given the POSIX path to the folder as its first argument:
#!/bin/sh
dir=`dirname "$1"`
top=`basename "$1"`
cd "$dirname" && zip -r "$top.zip" "$top"
On Fri, Mar 25, 2011 at 8:34 AM, Jay Louvion <email@hidden> wrote:
>
> Thanks – that works really nicely once adapted to my needs.
> Surprised though I would have to throw in some 'ditto' and not be able to
> only use 'zip'.
> Whatever.
> Have a great week-end.
> Best,
> j.
>
> Jay Louvion
> Studio Casagrande
> 3, rue Müller-Brun
> 1208 Geneva
>
> T+4122 840 3272
> F+4122 840 3271
>
> www.studiocasagrande.com
>
> P Please consider the environment before printing this email.
> On 25.03.2011 12:54, "Eduardo Sato" <email@hidden> spake thus:
>
> Hi! What's up?
>
> Jay, have a look
> here: http://www.iscriptnetcast.com/index.php?option=com_content&task=view&id=6
>
> Maybe that link will help you. There you can find a script that uses "do
> shell script" command and command line tools (like ditto and zip) in order
> to zip files and/or folders.
>
> Sincerely
>
> --
> Eduardo Sato
>
> On Friday, March 25, 2011 at 8:19 AM, Jay Louvion wrote:
>
> Hi all,
> I've been trying to get something which I thought fairly straight-forward
> (chuckle) to work but don't find a was to.
> Let's simply say I'm trying to zip a folder in the same way the Finder's
> contextual menu item "Create archive" does.
> I use the shell's zip command, with –r for recursiveness and –j to trash the
> path to the folder. Unfortunately, the –j option also scraps the subfolder
> hierarchy in the folder I am zipping, creating a zip archive containing all
> the files on the first level and making all the subfolders disappear. Drat.
> I previously painstakingly had to copy the folder to the startup disk, zip
> it there, then trash the copy of the folder, move the zip file back up to
> whichever of my user folders it should be situated in. Snow Leopard's
> security freak-out has put an end to that.
> So please help me to do what's right (in Snow Leo's terms) and correct (in
> the sense that I want to keep my subfolders, thanks a lot).
> j.
>
> Jay Louvion
> Studio Casagrande
> 3, rue Müller-Brun
> 1208 Geneva
>
> T+4122 840 3272
> F+4122 840 3271
>
> www.studiocasagrande.com
>
> P Please consider the environment before printing this email.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >Re: Zippin' (From: Jay Louvion <email@hidden>) |