Hello,

I am having some difficulty downloadinging a file with the Net::FTP module.
When I run the following test script I am able to download a file that
appears
to be slightly smaller than the file on the FTP site. In addition, when I
'gunzip'  the file I get the following error:

gunzip: gbest1.seq.gz: invalid compressed data--format violated

Interestingly when I download the file using FTP from the command line
the file ends up being of the appropriate size and I am able to gunzip the
file
with no errors. Does anyone have any ideas as to what I'm doing wrong. I
am running perl 5.8.0 on IRIX 6.5 OS.

Thanks

#!/usr/bin/perl -w
use strict;
use Net::FTP;

my $hostname   = 'ftp.ncbi.nih.gov';
my $username   = 'anonymous';
my $password   = '[EMAIL PROTECTED]';
my $path       = 'genbank';
my $filename   = 'gbest1.seq.gz';

#use Net::FTP module to download file from NCBI ftp site
my $ftp = Net::FTP->new($hostname) ||
    die "Could not contact server.";
$ftp->login($username, $password) ||
    die "Could not login.";
$ftp->cwd($path) ||
    die "Could not cd to $path.";
$ftp->get($filename) ||
    die "Could not get file.";
$ftp->quit();

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to