When I use FTP.open(host) or FTP.new(host) it always assume that I want to use port 21 by default. Is there a way to modify this? Like, does it exist a variable in the FTP class that I can modify in real time? (I don''t want to use the "connect" function in the library) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 15 Jan 2008, at 10:35, Andreas Secret wrote:> > When I use FTP.open(host) or FTP.new(host) it always assume that I > want > to use port 21 by default. Is there a way to modify this? Like, > does it > exist a variable in the FTP class that I can modify in real time?Net::FTP uses the port defined in the FTP_PORT constant. Changing that should allow you to connect to a different port. http://www.rubycentral.com/pickaxe/lib_network.html Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt wrote:> On 15 Jan 2008, at 10:35, Andreas Secret wrote: > >> >> When I use FTP.open(host) or FTP.new(host) it always assume that I >> want >> to use port 21 by default. Is there a way to modify this? Like, >> does it >> exist a variable in the FTP class that I can modify in real time? > > Net::FTP uses the port defined in the FTP_PORT constant. Changing > that should allow you to connect to a different port. > > http://www.rubycentral.com/pickaxe/lib_network.html > > Best regards > > Peter De BerdtThank you for the reference. But since It is a constant I do not want to change it (matter of principle, really) I''ll try to add a specific function to the library that does what I need -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The Ruby FTP library should really have an optional setter for specifying a non-standard port to use. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 1 May 2011 20:00, Marc Heiler <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> The Ruby FTP library should really have an optional setter for > specifying a non-standard port to use.??? Have you even read the docs? http://www.ruby-doc.org/stdlib/libdoc/net/ftp/rdoc/classes/Net/FTP.html Search for "port"... :-/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.