amitsk has asked for the wisdom of the Perl Monks concerning the following question:
I have a simple scenario. I upload a zip file on a disk to some server.
use Net::FTP; my $ftp = Net::FTP->new($server, Timeout=>1800, Passive=>1, Debug=>3); $ftp->login($user, $pswd); $ftp->cwd("files"); $ftp->binary(); $ftp->put("build.zip");
The put() succeeds 9 out of 10 times, but for the 10th time (and this is very random), it throws up.
This, I know is because of: 1. Server closing connection, or 2. Internet link break 3. Unknown
My question is what *really* tells me that put() has failed?
a. I have tried $ftp->message but this is empty.
b. $! as I know is not exactly the way, it tells me 'bad file descriptor'
c. I also used eval() with $ftp->message, but is empty as well
So what gives?
By the way, when I try this on a DOS prompt and stop the ftp server, this is what I get.
ftp bin
200 Type set to I
ftp mput build.zip
mput build.zip? y
200 Port command successful
150 Opening data channel for file transfer.
Netout :Software caused connection abort
421 Server is going offline
Connection closed by remote host.
Notice the last 3 lines, I know exactly what went wrong.
Your help is appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Net::FTP put() gives little help on errors
by stefbv (Priest) on Jan 07, 2010 at 09:11 UTC | |
|
Re: Perl Net::FTP put() gives little help on errors
by tokpela (Chaplain) on Jan 07, 2010 at 09:45 UTC | |
by amitsk (Initiate) on Jan 07, 2010 at 10:05 UTC | |
by cdarke (Prior) on Jan 07, 2010 at 10:40 UTC | |
|
Re: Perl Net::FTP put() gives little help on errors
by ruzam (Curate) on Jan 07, 2010 at 14:04 UTC | |
|
Re: Perl Net::FTP put() gives little help on errors
by poolpi (Hermit) on Jan 07, 2010 at 12:07 UTC |