From d3cdbc7eabeebc190b163c8cca6f254815226c4c Mon Sep 17 00:00:00 2001 From: Graham Barr Date: Mon, 13 Oct 2003 11:23:11 +0000 Subject: Net::FTP - Don't truncate local file during ->get after ->restart has been called --- Net/FTP.pm | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Net/FTP.pm b/Net/FTP.pm index beda695..5ec09b5 100644 --- a/Net/FTP.pm +++ b/Net/FTP.pm @@ -1,6 +1,6 @@ # Net::FTP.pm # -# Copyright (c) 1995-8 Graham Barr . All rights reserved. +# Copyright (c) 1995-2003 Graham Barr . All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # @@ -22,7 +22,7 @@ use Net::Config; use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC); # use AutoLoader qw(AUTOLOAD); -$VERSION = "2.72"; # $Id: //depot/libnet/Net/FTP.pm#80 $ +$VERSION = "2.73"; # $Id: //depot/libnet/Net/FTP.pm#81 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); # Someday I will "use constant", when I am not bothered to much about @@ -443,8 +443,7 @@ sub get croak("Bad remote filename '$remote'\n") if $remote =~ /[\r\n]/s; - ${*$ftp}{'net_ftp_rest'} = $where - if ($where); + ${*$ftp}{'net_ftp_rest'} = $where if defined $where; delete ${*$ftp}{'net_ftp_port'}; delete ${*$ftp}{'net_ftp_pasv'}; @@ -460,7 +459,7 @@ sub get { $loc = \*FD; - unless(sysopen($loc, $local, O_CREAT | O_WRONLY | ($where ? O_APPEND : O_TRUNC))) + unless(sysopen($loc, $local, O_CREAT | O_WRONLY | (${*$ftp}{'net_ftp_rest'} ? O_APPEND : O_TRUNC))) { carp "Cannot open Local file $local: $!\n"; $data->abort; @@ -1761,12 +1760,8 @@ Roderick Schertler - for various inputs =head1 COPYRIGHT -Copyright (c) 1995-1998 Graham Barr. All rights reserved. +Copyright (c) 1995-2003 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -=for html
- -I<$Id: //depot/libnet/Net/FTP.pm#80 $> - =cut -- cgit v1.2.3-24-ge0c7