Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > PHP exec("zip") help please

PHP exec("zip") help please
Thread Tools
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Feb 4, 2005, 01:13 AM
 
Hi,

I am using exec() in PHP to run the terminal program "zip". Is there a way to zip up a folder, and just that folder? FOr example, if I zip it normally, all the super-set folders show up in the zip. So like if my dir I want to zip is in /Site/zip_files/zipfolder/ and I zip it and expand it, there is a folder called Site, inside that, a folder called zip_files, and then finally my dir that I wanted to zip. I don't want the Site or zip_file part. I can't use the ignore dir option, because there are dir within the dir I want to zip.

With tar, I can do it using -directory first to navigate to the folder, then tar it.

Anyway to do this in PHP with exec? Maybe if not a zip option, then maybe I can change directories first, and have PHP remember that I changed dir before running zip.

Please help!
Thanks!
     
Junior Member
Join Date: Nov 2004
Location: Michigan
Status: Offline
Reply With Quote
Feb 4, 2005, 06:38 PM
 
zip -j
     
timmerk  (op)
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Feb 4, 2005, 06:40 PM
 
Originally posted by ctlq:
zip -j
"I can't use the ignore dir option, because there are dir within the dir I want to zip." (see above)

But I figured out how to - chdir()
     
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Feb 4, 2005, 08:29 PM
 
Originally posted by timmerk:
"I can't use the ignore dir option, because there are dir within the dir I want to zip." (see above)

But I figured out how to - chdir()
You figured out how to?
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
timmerk  (op)
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Feb 4, 2005, 08:30 PM
 
:-)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:08 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2