perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boysenberry Payne <boysenbe...@humaniteque.com>
Subject Re: Trying to get File and Directory info off of external server quickly
Date Tue, 02 Aug 2005 01:10:20 GMT
$ftp->{handle} = Net::FTP->new( $ftp->{host}, Passive => 1  ) or die  
"Can't create new ftp with host: $ftp->{host}";
It's part of my FTP module

Thanks,
Boysenberry

This message contains information that is confidential
and proprietary to Humaniteque and / or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.

http://www.habitatlife.com
The World's Best Site Builder
On Aug 1, 2005, at 6:31 PM, Philip M. Gollucci wrote:

> Boysenberry Payne wrote:
>> my $h = $ftp->{handle};
>> foreach my $directory ( @directories ) {
>>     $h->cwd( $directory ) or die "can't change to directory:  
>> $directory $!";
>>     my $dir_ls = $h->ls;
>>     foreach my $file_name ( @$dir_ls ) {
>>         unless ( substr( $file_name, 0, 1 ) eq "." ) {
>>             my $dir_nfo = $h->dir( $directory . $file_name );
>>             $_ = $dir_nfo->[ 0 ];
>>             s/(\s)+/ /g;
>>             my @file_nfo = split / /, $_;
>>             my $file_size = $file_nfo[ 4 ];
>>             if( $file_size != 0 ) {
>>                 add to database
>>             }
>>         }
>>     }
>> }
>> $h->quit;
> Whats this ftp->{handle} stuff ?
> Shouldn't it just be $ftp->xxx
> Thats not in perldoc Net::FTP.
>
> Are you using a relatively new version of it ?
> We've got Net::FTP 2.75,
> Linux wickedwitch 2.6.12.3 #2 SMP Mon Jul 18 17:14:55 EDT 2005 i686  
> i686 i386 GNU/Linux
>
> What is the file size check for .. why do you have files of size 0 ?
>
> I think it might be faster to do
>
> next unless $file_name =~ /^\./o;
>
> instead of
> >         unless ( substr( $file_name, 0, 1 ) eq "." ) {
>
> It might be your database connection... Do you prepare the handle  
> outside of the loop?  Is the database connect/disconnect outside of  
> the loop? What are you inserting into the database ? If you're  
> inserting a BLOB of the image/file data it could be the bandwidth  
> transfer now thats its not a local socket anymore.
>
> Luck
>
> --  
> END
> ----------------------------------------------------------------------- 
> ------
> Philip M. Gollucci
> Senior Developer - Liquidity Services Inc.
> Phone:  202.558.6268 (Direct)
> Cell:   301.254.5198
> E-Mail: pgollucci@liquidation.com
> Web:    http://www.liquidityservicesinc.com
>         http://www.liquidation.com
>         http://www.uksurplus.com
>         http://www.govliquidation.com
>         http://www.gowholesale.com
>
>
>


Mime
View raw message