Re: What's wrong with this call to zip?
Re: What's wrong with this call to zip?
- Subject: Re: What's wrong with this call to zip?
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 27 Feb 2008 07:30:14 -0500
Ditto is a fine solution - I didn't realize it would create zip files
- but using zip is just a matter of specificity. It creates the zip
file exactly where you tell it to, and archives the files with exactly
the paths you give it. .
On 2/27/08, Axel Luttgens <email@hidden> wrote:
> Le 27 févr. 08 à 12:05, KOENIG Yvan a écrit :
>
> >
> > Le 26 févr. 2008 à 22:58, Mark J. Reed a écrit :
> >
> >> The "zip" command requires you to give it the name of the zip file to
> >> create, before the list of files to add to it. And if you want to
> >> include a folder with all its contents, you need to supply the -r
> >> option. In Terminal it looks like this:
> >>
> >> zip -r newfile.zip /path/to/some/directory/
> >
> >
> >
> > Thank's but it doesn' work.
> >
> > If I pass (as you wrote) a simple name for the dest file it doesn't
> > create an archive.
>
>
> Hello Yvan,
>
> It may have created it, but perhaps not at the location you expected
> to see it...
> For example, if you run this one in Script Editor:
> do shell script "pwd"
> you may get
> "/"
> in the result pane. [1]
> That is, on my box and for a shell script run from "Script Editor",
> the current working directory is the root of the boot volume; so, it
> is very likely that zip would have created its archive there.
>
>
> > If I pass a pathname, I get the archive "les_fonctions_Numbers
> > +.rtfd.tgz" on the desktop
> > but when I expand it, I don't get the "les_fonctions_Numbers+.rtfd"
> > but a folder named "Users" containing
> > a subfolder named "yvankoenig" containing
> > a folder named "Desktop" containing
> > two files:
> >
> > "les_fonctions_Numbers+.rtfd"
> > and
> > "les_fonctions_Numbers+.rtfd.06c"
> >
> > This is not what I wish ;-)
>
>
> That's because zip takes into account the hierachy, as passed in its
> arguments, of the files/folder to be archived.
> Perhaps could you consider soemthing like this:
> cd ~/Desktop
> zip -r les_fonctions_Numbers+.rtfd.zip les_fonctions_Numbers+.rtfd
> assuming item "les_fonctions_Numbers+.rtfd" is on your desktop?
>
> HTH,
> Axel
>
>
> [1] Note that this may change from one version of AppleScript to
> another, and even depend on the execution context (Script Editor vs an
> applet, for example); the rule is: never rely on a default current
> working directory...
>
>
>
> _______________________________________________
> 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