Forum: Ruby Re: FTP#mget, FTP#mput

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-05-10 18:08
(Received via mailing list)
> >
> this does something like mput

I guess I'm not sure how this is different that just doing something
like this:

module Net
   class FTP
      def mput(pattern, &block)
         Dir[pattern].each{ |file| put(file, &block) }

      def mget(pattern, &block)
         Dir[pattern].each{ |file| get(file, &block) }

I haven't test that, but if it looks alright perhaps I'll submit it as a
patch to -core.



This communication is the property of Qwest and may contain confidential
privileged information. Unauthorized use of this communication is
prohibited and may be unlawful.  If you have received this communication
in error, please immediately notify the sender by reply e-mail and
all copies of the communication and any attachments.
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-05-10 18:18
(Received via mailing list)
On Thu, 11 May 2006, Berger, Daniel wrote:

>> this does something like mput
>      end
>      def mget(pattern, &block)
>         Dir[pattern].each{ |file| get(file, &block) }
>      end

Dir[pattern] is on the __client__.  globbing for mget most occur against
listing from the __server__.


     mget foo*

   means get all files from the server that match foo* - the only way to
   this is to combine an ftp.list with fnmatch.


E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-05-10 18:21
(Received via mailing list)
On May 10, 2006, at 12:06 PM, Berger, Daniel wrote:

>> this does something like mput
>       end
> Regards,
> Dan

I'm not sure but I think mget's pattern is supposed to apply on the
server, not the local system. I could be wrong though.
This topic is locked and can not be replied to.