in reply to Re^2: Aborting ftp
in thread Aborting ftp

Your assumptions are correct. I try to make an ftp client with NET::FTP. It's not that I have no prompt, The execution stucks on $ftp->get(). I just want to do other staff. I don't want to waste your time, I just want to know if I did something wrong or if it's just the case with get(). I thought that forking would allow me to read from STDIN. Thanks for your time so far.

Replies are listed 'Best First'.
Re^4: Aborting ftp
by Marshall (Canon) on Jan 01, 2009 at 06:06 UTC
    I think that the first reply to your post was on target. I have looked at the Net::FTP doc's and this appears to be "spot on". I suspect that your problem is at a much higher level than just getting the file. First, you have to authenticate and get logged-on. Follow the steps below.
    use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 1) or die "Cannot connect to some.host.name: $@"; $ftp->login("your_name",'password') or die "Cannot login ", $ftp->message; $ftp->cwd("remote_dir") #cwd at remote site may not #be necessary depending upon your logon. or die "Cannot change working directory ", $ftp->message; $ftp->get("somefilename") or die "get failed ", $ftp->message;
    Wish you well...

      Thank you so much for everything Marshall.I did all these. I will try to solve this later. If I find something I'll let you know. Have a wonderfull year

Re^4: Aborting ftp
by Marshall (Canon) on Jan 01, 2009 at 01:31 UTC
    Hi, I've been busy with things other than software for the past couple of days.

    I don't know what OS you have, but fork() on Windows is a mess! This doesn't work like on *NIX and is not transportable code.

    I would suggest getting this working from the command line first. "prompt> ftp -h" will display some not so helpful "help". Other ways: most browsers(IE,Firefox, etc) allow FTP://..someurl.. Also, I use WinSCP (a Windows program) for a lot of transfers to secure sites. This is freeware.

    Maybe you don't even need a Perl program at all?