Home : Products : Others : Fileman :

Products: Others: Fileman: Re: [pjt_ren] I've an idea for the fileman!: Edit Log

Here is the list of edits for this post
Re: [pjt_ren] I've an idea for the fileman!
Not all servers support unzipping.

You could create a simple routine to do it though if you have "unzip" installed on your server...


Code:
sub unzip {
#-----------------------------------------
# Unzip a zip file.

my $file = shift;
my $path = locate_unzip() or die "Cannot locate unzip binary";
my $output = qx/$path $file/;

return $output;

}

sub locate_unzip {
#------------------------------------------
# Locate the unzip binary.

my @opts = qw(/bin/unzip /usr/bin/unzip /usr/sbin/unzip /usr/local/bin/unzip);

for (@opts) {
-x $_ and return $_;
}

return 0;
}


Well thats just a basic example...you'd probably need to make changes to get it to work with fileman.

Last edited by:

RedRum: Feb 18, 2002, 3:19 AM

Edit Log: