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))
redirest FTP output to a text file using perl

Posted by freebird123 (freebird123), 16 April 2008
i am using perl script to login to ftp and i want to check the bytes transferred,the size of file and time taken to download

I want to redirect the output of ftp to a text file using perl script.Please help me ..its urgent....It would be very kind n helpful if someone replies asap....


Posted by KevinAD (KevinAD), 16 April 2008
Why is it urgent?

Posted by freebird123 (freebird123), 16 April 2008
As I have to complete it by today itself because of the deadlines

Still stuck with it...

Posted by admin (Graham Ellis), 16 April 2008
You'll find that I have answered in another thread - there's really no need to ask the question twice.  And, much as we would like to be able to help everyone who has an urgent problem, we're not able set up to provide a service that responds in just an hour or two.  You're welcome to ask questions / have discussions that will be on a 24 hour cycle or so, but if you need answers in a tenth of that time you would be better suited with a company who can sell you a support contract.

Posted by freebird (freebird), 17 April 2008
Thanks for your advice ,but it did not help me much....
and I am sorry if such type of queries are bothering you...

Posted by admin (Graham Ellis), 17 April 2008
on 04/17/08 at 03:41:41, freebird wrote:
Thanks for your advice ,but it did not help me much....
and I am sorry if such type of queries are bothering you...

Queries really don't "bother" me - I'm delighted to receive them. However, I really dislike it when people get false expectations about what we can and cannot do on a forum such as this; false expectations leave you disappointed, and people who post answers up frustrated.   Here are a few tips for you, and for others too, to help you get the most of the resources here

I run this forum primarily for customers of our training course, each of whom I have personally taught  in small groups.  That means that I have a good background to them and can quickly and effectively help them.  For other who I do not know, I don't have that background so there's more work in providing such support, and it cannot be done "urgent"ly - because customers come first, because my time is limited and because - well a free service has to simply fill in the gaps as and when time is available. If you need urgent answers on occasions, customers are very welcome to email, others are very welcome to use contract services who can help them.  There are plenty of other sources of help and if none of them comes good for you, look at yourself rather than them.

It's also very hard indeed for posters to know what level you know Perl to when you post.  And sometimes assumptions will be made;  I suspect that was the case in the answer I gave in the other thread where I have given you pointers towards a correct answer.  We cannont be a "teach me Perl via a forum" resource - a forum is a lousy way to learn a language from a low knoweledge point (try this instead), nor are we a "please write this program for me" site.

But ... use us for what we're intended for, which is technical tips and specific on bits of code and help over individual issues that you have once you  know Perl to a certain level, and we're delighed to provide that technical help.

Posted by freebird (freebird), 17 April 2008
I am extremely sorry for this kind of reply.I am not that good in PERL,I agree.

But Its just I am helpless to get the query solved in right way.SO thats the only worry..

Thanks again for the advice ,but what u told the time elapsed and the size of file should be used to get the transfer rate,but I am not able to get the time elapsed using perl.I am printing the message after the put but its just showing status which  is transfer complete.

If you can help me i will be very much obliged.I dnt need the code but a small hint which can help me to get the desired output.


Posted by admin (Graham Ellis), 17 April 2008
$start = time();
sleep 2;
# Replace these sleeps with your FTP transfer
sleep 4;
$end = time();
$elapsed = $end - $start;
print "elapsed time = $elapsed\n";

Little poing in giving you a hint; the code above shows an example of how to calculate an elapsed time.   My answer if full of helpful tips and suggestions of how to get help,  from us and elsewhere. They come from a number of years of experience; I know what works and does not work and you will really help yourself if you follow them.

I am puzzled by the two sign-ups - "freebird123" and "freebird".  Are they both you?  

Posted by freebird (freebird), 18 April 2008

First of all I apologize for the harsh response I made on ur reply two days back......

Second,I tried ur idea of elapsed time...and yes it works of course....Thanks for ur help....Its giving me the transferred rate...
I respect your experience and knowledge in scripting..just  i got bit upset on ur reply & thats the only reason i replied u harshly ..if i would have understood the reply I would have got ur hint that day itself...well thanks again..Both of the username are mine..

Take care

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