For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > March 2004 > Errors from Net::FTP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Errors from Net::FTP
Bernie Cosell

2004-03-29, 8:32 am

I'm wondering why I'm not seeing the error messages from Net::FTP... I try
to run the program and I get the error:

Couldn't rename request ftpapd.0329.6373.2:

But the code is:

$ftp->rename ("tmp$file", $file)
or die "Couldn't rename request $file: $@\n" ;

Two things:

1) the program is actually sending several files using the same code in a
loop -- in the case above, it failed uploading/renaming the second file.

2) I looked at Net::FTP and it sure seems to copy the returned FTP error
code into $@, but nonetheless I'm getting "blank" back.

Any thoughts on what could be causing the error [and/or where I could find
some error info about what's going on?]. I glanced through Net::FTP and it
didn't look like messing with the debugging stuff would get me any more
information about why the rename failed [the second time through the loop].

Thanks!
/Bernie\

--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
Tim Heaney

2004-03-29, 8:32 am

Bernie Cosell <bernie@fantasyfarm.com> writes:

> I'm wondering why I'm not seeing the error messages from Net::FTP... I try
> to run the program and I get the error:
>
> Couldn't rename request ftpapd.0329.6373.2:
>
> But the code is:
>
> $ftp->rename ("tmp$file", $file)
> or die "Couldn't rename request $file: $@\n" ;


How about something like this?

$ftp->rename ("tmp$file", $file)
or die "Couldn't rename request $file: ", $ftp->message;

I hope this helps,

Tim
Thomas Kratz

2004-03-30, 4:37 am

Bernie Cosell wrote:
> I'm wondering why I'm not seeing the error messages from Net::FTP... I try
> to run the program and I get the error:
>
> Couldn't rename request ftpapd.0329.6373.2:
>
> But the code is:
>
> $ftp->rename ("tmp$file", $file)
> or die "Couldn't rename request $file: $@\n" ;
>
> Two things:
>
> 1) the program is actually sending several files using the same code in a
> loop -- in the case above, it failed uploading/renaming the second file.
>
> 2) I looked at Net::FTP and it sure seems to copy the returned FTP error
> code into $@, but nonetheless I'm getting "blank" back.
>
> Any thoughts on what could be causing the error [and/or where I could find
> some error info about what's going on?]. I glanced through Net::FTP and it
> didn't look like messing with the debugging stuff would get me any more
> information about why the rename failed [the second time through the loop].


Why do you think so? Have you tried it? Setting $ftp->debug(1) should give
you a complete printout of the ftp conversation in cleartext on STDERR.

Thomas

--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(s( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
Bernie Cosell

2004-03-30, 9:36 am

Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote:

} Bernie Cosell wrote:

} > ... I glanced through Net::FTP and it
} > didn't look like messing with the debugging stuff would get me any more
} > information about why the rename failed [the second time through the loop].
}
} Why do you think so? Have you tried it? Setting $ftp->debug(1) should give
} you a complete printout of the ftp conversation in cleartext on STDERR.

I'll give it a try. A "complete printout" isn't _exactly_ what I want,
but it is better than what I get now [which is an empty $@].

Still doesn't answer why I'm getting that.. I wonder if the connection
could be breaking [and so I'm getting an error out of the socket machinery
rather than out of the ftp protocol]...

/Bernie\

--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com