Odd Net::FTP behavior

Discussion in 'Ruby' started by rubyhacker@gmail.com, Aug 10, 2006.

  1. Guest

    Here's my (simple) code. This has worked fine in the past;
    now even this simple example fails for me.

    It gets as far as creating an empty file, then it hangs and
    times out.

    This is Ruby 1.8.4 on FC4, talking to another Linux box
    (RH Enterprise I think).

    Any ideas?

    Hal


    domain, user, password = "mydomain.com", "myuser", "mypass"
    args = [domain]
    args << user << password if user != nil
    puts "Connecting..."
    @ftp = Net::FTP.new(*args)
    @rempath = "/var/www/html/whatever/"
    puts "Change dir..."
    @ftp.chdir(@rempath)

    puts "Upload file..."
    @ftp.puttextfile("foobar","foobar-rem") # Hangs here!
    puts "Closing..."
    @ftp.close
    puts "Finished."
     
    , Aug 10, 2006
    #1
    1. Advertising

  2. Guest

    On Fri, 11 Aug 2006 wrote:

    > Here's my (simple) code. This has worked fine in the past;
    > now even this simple example fails for me.
    >
    > It gets as far as creating an empty file, then it hangs and
    > times out.
    >
    > This is Ruby 1.8.4 on FC4, talking to another Linux box
    > (RH Enterprise I think).
    >
    > Any ideas?
    >
    > Hal
    >
    >
    > domain, user, password = "mydomain.com", "myuser", "mypass"
    > args = [domain]
    > args << user << password if user != nil
    > puts "Connecting..."
    > @ftp = Net::FTP.new(*args)
    > @rempath = "/var/www/html/whatever/"
    > puts "Change dir..."
    > @ftp.chdir(@rempath)
    >
    > puts "Upload file..."
    > @ftp.puttextfile("foobar","foobar-rem") # Hangs here!
    > puts "Closing..."
    > @ftp.close
    > puts "Finished."


    @ftp.passive = true ??

    -a
    --
    to foster inner awareness, introspection, and reasoning is more efficient than
    meditation and prayer.
    - h.h. the 14th dali lama
     
    , Aug 10, 2006
    #2
    1. Advertising

  3. Guest

    wrote:
    > On Fri, 11 Aug 2006 wrote:
    > >
    > > Any ideas?

    >
    > @ftp.passive = true ??
    >


    Quite right, thank you.

    Never needed that before. Wonder why I do now.
    Not even sure what passive means.

    Eventually I'll move this app on to sftp anyway.


    Thanks,
    Hal
     
    , Aug 10, 2006
    #3
  4. Guest

    On Fri, 11 Aug 2006 wrote:

    >
    > wrote:
    >> On Fri, 11 Aug 2006 wrote:
    >>>
    >>> Any ideas?

    >>
    >> @ftp.passive = true ??
    >>

    >
    > Quite right, thank you.
    >
    > Never needed that before. Wonder why I do now.
    > Not even sure what passive means.
    >
    > Eventually I'll move this app on to sftp anyway.
    >
    > Thanks,
    > Hal


    it's kinda confusing - i stumble on it from time to time - probably better to
    google it than listen to me. in any case the change would have been due to a
    change on the server - not your stuff. probably ;-)

    -a
    --
    to foster inner awareness, introspection, and reasoning is more efficient than
    meditation and prayer.
    - h.h. the 14th dali lama
     
    , Aug 10, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewR
    Replies:
    1
    Views:
    2,661
    AndrewR
    Sep 15, 2005
  2. Replies:
    3
    Views:
    5,718
  3. Michael Speer

    Odd behavior with odd code

    Michael Speer, Feb 16, 2007, in forum: C Programming
    Replies:
    33
    Views:
    1,140
    Richard Heathfield
    Feb 18, 2007
  4. AndrewR

    ASP.Net (VB) DataList Control odd behavior ?

    AndrewR, Sep 14, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    209
    AndrewR
    Sep 15, 2005
  5. D. Buck
    Replies:
    2
    Views:
    540
    D. Buck
    Jun 29, 2004
Loading...

Share This Page