Net::FTP 'put' truncates file 
Author Message
 Net::FTP 'put' truncates file

When I send a file with the 'put' function of Net::FTP, the file is
truncated and the whole file is not sent.  This happens using ascii and
binary mode.

I read somewhere that this was a bug that was corrected a while
ago, but I'm using version 2.40 of FTP.pm and I still have this problem.

I'm on a Solaris machine.

Thanks for any help,
Lara

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 20 May 2002 03:00:00 GMT  
 Net::FTP 'put' truncates file

Quote:

> When I send a file with the 'put' function of Net::FTP, the file is
> truncated and the whole file is not sent.  This happens using ascii
and
> binary mode.

> I read somewhere that this was a bug that was corrected a while
> ago, but I'm using version 2.40 of FTP.pm and I still have this
problem.

> I'm on a Solaris machine.

> Thanks for any help,
> Lara

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sorry but this is not a solution for your problem.  I want to find a
fix for the same problem when doing a 'put' from an NT PC to a Solaris
system.

Here is my code:

$ftp->ascii()
        or die "Couldn't set transfer mode to ASCII.\n";

$ftp->put("$fidout","$rdir/$fidout")
        or die "Couldn't send $fidout to $rhost: $!\n";

I'm successful doing a manual FTP using WINFTP but the file is
truncated using my Perl code.

Can some PLEASE HELP us?

--
Keith Picard

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 17 Jun 2002 03:00:00 GMT  
 Net::FTP 'put' truncates file

Quote:

> Sorry but this is not a solution for your problem.  I want to find a
> fix for the same problem when doing a 'put' from an NT PC to a Solaris
> system.
> Here is my code:
> $ftp->ascii()
>         or die "Couldn't set transfer mode to ASCII.\n";
> $ftp->put("$fidout","$rdir/$fidout")
>         or die "Couldn't send $fidout to $rhost: $!\n";
> I'm successful doing a manual FTP using WINFTP but the file is
> truncated using my Perl code.

What's the last character that gets transferred, and the first one that
doesn't? Also, does it return an error? Have you checked to see what
$ftp->message() returns after the transfer? Do you have the same problem
when doing the transfer with ->write() instead of put?

                                        Dan



Mon, 17 Jun 2002 03:00:00 GMT  
 Net::FTP 'put' truncates file
Sorry for my delay.



Quote:

> What's the last character that gets transferred, and the first one
> that doesn't?

The number of characters transferred appears to be a multiple of 1024.
For example, if I'm expecting 21270 characters I only get 20480!

Quote:
> Also, does it return an error? Have you checked to see what
> $ftp->message() returns after the transfer?

Nothing suspicious looking

Quote:
> Do you have the same problem when doing the transfer with ->write()
> instead of put?

write() does nothing.  That is, no transfer.

--
Keith Picard

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 24 Jun 2002 03:00:00 GMT  
 Net::FTP 'put' truncates file

Quote:

> Sorry for my delay.


>> What's the last character that gets transferred, and the first one
>> that doesn't?
> The number of characters transferred appears to be a multiple of 1024.
> For example, if I'm expecting 21270 characters I only get 20480!

That's very odd.

Quote:
>> Also, does it return an error? Have you checked to see what
>> $ftp->message() returns after the transfer?
> Nothing suspicious looking
>> Do you have the same problem when doing the transfer with ->write()
>> instead of put?
> write() does nothing.  That is, no transfer.

Nothing? Something is definitely wrong, since that's pretty much what
Net::FTP uses internally. Does this fail going to other servers or just to
this one?

                                        Dan



Mon, 24 Jun 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. File truncate with put in NET::FTP

2. $ftp->put stores empty file (Net::FTP)

3. win32 ftp'put problem with ftp.pl

4. Net::FTP truncates files

5. Net::FTP 'put' fails with HPUX 10.20 FTP server

6. Net::FTP->ls('*.rcp');

7. Net::FTP failure using 'retr'?

8. Can't Net::FTP - 425 Can't build data connection: Connection refused

9. Net::FTP hash ('#') option

10. Net::FTP->ls('*.rcp');

11. multiple Net::FTP 'get's ?

12. Newbie: Net::FTP, putting more than one file at a time

 

 
Powered by phpBB® Forum Software