diff options
author | Graham Barr <gbarr@pobox.com> | 2004-06-29 15:39:20 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 2009-02-24 08:51:38 -0600 |
commit | b6bed8c2160621f180f5c58db9cfccfc26a6a565 (patch) | |
tree | 56bf2c61cc211119ec731bb76228ba873c925fc2 | |
parent | 4fdf870dc660aa87785909ecbe114b4f7040e0e7 (diff) | |
download | perl-libnet-b6bed8c2160621f180f5c58db9cfccfc26a6a565.tar.gz |
Fixed bug that a restarted get with Net::FTP did not append to local file
-rw-r--r-- | Net/FTP.pm | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,6 @@ # Net::FTP.pm # -# Copyright (c) 1995-2003 Graham Barr <gbarr@pobox.com>. All rights reserved. +# Copyright (c) 1995-2004 Graham Barr <gbarr@pobox.com>. 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.74"; # $Id: //depot/libnet/Net/FTP.pm#84 $ +$VERSION = "2.75"; @ISA = qw(Exporter Net::Cmd IO::Socket::INET); # Someday I will "use constant", when I am not bothered to much about @@ -457,6 +457,7 @@ sub get if $remote =~ /[\r\n]/s; ${*$ftp}{'net_ftp_rest'} = $where if defined $where; + my $rest = ${*$ftp}{'net_ftp_rest'}; delete ${*$ftp}{'net_ftp_port'}; delete ${*$ftp}{'net_ftp_pasv'}; @@ -472,7 +473,7 @@ sub get { $loc = \*FD; - unless(sysopen($loc, $local, O_CREAT | O_WRONLY | (${*$ftp}{'net_ftp_rest'} ? O_APPEND : O_TRUNC))) + unless(sysopen($loc, $local, O_CREAT | O_WRONLY | ($rest ? O_APPEND : O_TRUNC))) { carp "Cannot open Local file $local: $!\n"; $data->abort; @@ -1782,7 +1783,7 @@ Roderick Schertler <roderick@gate.net> - for various inputs =head1 COPYRIGHT -Copyright (c) 1995-2003 Graham Barr. All rights reserved. +Copyright (c) 1995-2004 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. |