Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Odd Net::FTP behavior

Reply
Thread Tools

Odd Net::FTP behavior

 
 
rubyhacker@gmail.com
Guest
Posts: n/a
 
      08-10-2006
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."

 
Reply With Quote
 
 
 
 
ara.t.howard@noaa.gov
Guest
Posts: n/a
 
      08-10-2006
On Fri, 11 Aug 2006 http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
 
 
 
rubyhacker@gmail.com
Guest
Posts: n/a
 
      08-10-2006

(E-Mail Removed) wrote:
> On Fri, 11 Aug 2006 (E-Mail Removed) 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

 
Reply With Quote
 
ara.t.howard@noaa.gov
Guest
Posts: n/a
 
      08-10-2006
On Fri, 11 Aug 2006 (E-Mail Removed) wrote:

>
> (E-Mail Removed) wrote:
>> On Fri, 11 Aug 2006 (E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd behavior with odd code Michael Speer C Programming 33 02-18-2007 07:31 AM
VERY odd routing behavior when attempting VPN connections over Wifi Robert Gordon Wireless Networking 0 08-25-2005 04:04 PM
Firefox under Linux -- odd behavior Dennis J. Tuchler Firefox 0 07-28-2004 04:05 PM
Odd behavior behind the PIX Charles Haron Cisco 1 04-21-2004 04:05 AM
Odd console behavior on Cat 5005 Mike Voss Cisco 0 11-19-2003 10:49 PM



Advertisments