Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2023 - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
FTP GET for a large file from mainframe.

Posted by gauri (gauri), 29 June 2006
I'm trying to do an FTP GET a file from mainframe to Linux.
I have a perl daemon on Linux which issues the follwing commands-

my $ftp=Net::FTP->new($MVSADDR,Timeout=>1800,Debug=>1);

my $olddir = getcwd();
chdir(makedir()) or $ftp=0;



$ftp->get(remote file,localfile);


and I get the follwing messages from FTP server:

220-FTPD1 IBM FTP CS V1R7 at, 21:48:41 on 2006-06-29.
220 Connection will close if idle for more than 15 minutes.
user xxxxxxx
331 Send password please.
PASS ....
230 xxxxxxx is logged on.  Working directory is "xxxxxxx.".
200 Representation type is Image
227 Entering Passive Mode (162,44,231,228,7,34)
PORT 162,44,231,235,159,195
200 Port request OK.
RETR 'G1ZIP01.TST.ET770056.FILE001.SPLIT001'
125 Sending data set G1ZIP01.TST.ET770056.FILE001.SPLIT001
250 Transfer completed successfully.

221 Quit command received. Goodbye.

The above script downloads a file of 200 bytes correctly.

However a 50 MB or more file is downloaded as a zero byte file and a successful transfer message is received.

When I manually try to do the ftp for 300 MB file, it downloads correctly in 40 seconds.

Why does the script download a zero byte file?
What do I need to do to have the complete file transferred correctly-whatever the size!!

-Please help.


Posted by admin (Graham Ellis), 30 June 2006
I tested out the following code:

use Net::FTP;
my $ftp=Net::FTP->new("",Timeout=>1800,Debug=>1);

(password changed before publication, of course!) and it correctly downloaded my 89 Mbyte compressed SQL backup file.

I can't see anything wrong in the code you have posted, but I do note that it's incomplete - perhaps a few lines that you felt to be the important ones cut and pasted from a larger application, and there's also a certain amount of pseudocode in there.  Can I suggest  you start by getting an example as simple as mine working as a test case, like I did, then work up from there; I suspect that your problem and the clues to it lie may not lie in the code you posted.

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2023: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho