# Re: FTP#mget, FTP#mput

**URL:** <https://www.ruby-forum.com/t/re-ftp-mget-ftp-mput/94670>\
**Category:** Ruby\
**Created:** [May 10, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/re-ftp-mget-ftp-mput/94670 "2006-05-10T18:27:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [May 10, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/re-ftp-mget-ftp-mput/94670/1 "2006-05-10T18:27:49Z")

</div>

> > > From: removed\_email\_address@domain.invalid [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
> > > mget and mput
> 
> means get all files from the server that match foo\* - the  
> only way to do  
> this is to combine an ftp.list with fnmatch.

Whoops, yeah. Something like this then:

# Untested

def mget(pattern, &block)  
list.each{ |file|  
next unless File.fnmatch(pattern, file)  
get(file, &block)  
}  
end

Regards,

Dan

This communication is the property of Qwest and may contain confidential  
or  
privileged information. Unauthorized use of this communication is  
strictly  
prohibited and may be unlawful. If you have received this communication  
in error, please immediately notify the sender by reply e-mail and  
destroy  
all copies of the communication and any attachments.
