in reply to Read part of a file over FTP
This uses Net::FTP to fetch the first two hundred bytes of a 180k file:
#! perl -slw use strict; use Net::FTP; my $ftp = Net::FTP->new( 'ftp.software.ibm.com' ); $ftp->login( 'anonymous', 'anonymous@' ); $ftp->cwd( '/ftp' ); $ftp->ascii; my $xfr = $ftp->retr( '00_Catalog' ); my $buf; $xfr->read( $buf, 200 ); print $buf;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read part of a file over FTP
by ronin78 (Novice) on May 27, 2011 at 19:29 UTC | |
by ronin78 (Novice) on May 27, 2011 at 19:32 UTC | |
by BrowserUk (Patriarch) on May 27, 2011 at 19:41 UTC | |
by ronin78 (Novice) on May 27, 2011 at 19:52 UTC |