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 > Perl or CGI for browsing .zip or .sit contents?

Perl or CGI for browsing .zip or .sit contents?
Thread Tools
Forum Regular
Join Date: Oct 1999
Location: London
Status: Offline
Reply With Quote
Jan 23, 2001, 06:27 PM
 
Is there any way via a Perl script to browse the contents of .zip or .sit archives?

There are plenty of Mac tools that do this ... not sure about MacOSX (or UNIX, really ... I'd like to write a shell script that did this).

Any help is GREATLY appreciated ...

     
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Jan 23, 2001, 07:40 PM
 
How are you wanting to "browse" the archives? If you just want to see a dump, type (for .zip):

jar ftv [ARCHIVE_NAME]

and it will dump it out for you. If you want to "browse" the archives from a web server (E.G., to serve the contents of a .zip file as if it were the root of a web site), there is java code to do that also.

Stuffit files are pretty much up to Aladdin to implement.
     
Forum Regular
Join Date: Oct 1999
Location: London
Status: Offline
Reply With Quote
Jan 23, 2001, 08:16 PM
 
Wow ... thank'ee ...

What I'm looking to do is "peek" inside archives on a server and take a numerical count of the files contained therein as part of a CGI-script utility.

So for .zip archives your suggestion works wonderfully.

"If you want to "browse" the archives from a web server (E.G., to serve the contents of a .zip file as if it were the root of a web site), there is java code to do that also."

That sounds VERY interesting, though not exactly what I need to do at this point. A pity StuffIt files can't be browsed in this fashion ...

Many thanks!
     
Forum Regular
Join Date: Oct 1999
Location: London
Status: Offline
Reply With Quote
Jan 27, 2001, 06:54 AM
 
Alas, while running it from the command line works wonderfully, running it with the header as part of a standard CGI-script doesn't work!

#!/usr/local/bin/perl -w
use CGI qw(:standard);
use Cwd;
print header;

Remove that and it executes! Hmmm ...
     
   
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 12:10 PM.
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