source: trunk/essentials/dev-lang/perl/lib/Net/FTP/I.pm

Last change on this file was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 1.6 KB
Line 
1## $Id: //depot/libnet/Net/FTP/I.pm#13 $
2## Package to read/write on BINARY data connections
3##
4
5package Net::FTP::I;
6
7use vars qw(@ISA $buf $VERSION);
8use Carp;
9
10require Net::FTP::dataconn;
11
12@ISA = qw(Net::FTP::dataconn);
13$VERSION = "1.12";
14
15sub read {
16 my $data = shift;
17 local *buf = \$_[0]; shift;
18 my $size = shift || croak 'read($buf,$size,[$timeout])';
19 my $timeout = @_ ? shift : $data->timeout;
20
21 my $n;
22
23 if ($size > length ${*$data} and !${*$data}{'net_ftp_eof'}) {
24 $data->can_read($timeout) or
25 croak "Timeout";
26
27 my $blksize = ${*$data}{'net_ftp_blksize'};
28 $blksize = $size if $size > $blksize;
29